| Summary: | clipboard (paste, copy, and cut) events don't fire on the focused element | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Jimmy Thomsen <jimmy> |
| Component: | HTML Editing | Assignee: | Nobody <webkit-unassigned> |
| Status: | NEW --- | ||
| Severity: | Normal | CC: | cdumez, hi, rniwa, smoley, webkit-bug-importer, wenson_hsieh |
| Priority: | P2 | Keywords: | InRadar |
| Version: | Safari 13 | ||
| Hardware: | Mac | ||
| OS: | macOS 10.13 | ||
|
Description
Jimmy Thomsen
2020-12-07 06:16:36 PST
Thanks for filing, I can reproduce this on Safari 13.1.3 and STP 116. Same bug applies to OnCopy and OnCut. I have extended the JSFiddle to also register OnCopy and OnCut handlers: https://jsfiddle.net/7puam9yr/1/ A fix should probably be tested against all relevant events. Programmatically invoking cut/copy/paste does not trigger the events either, nor does it modify the clipboard (unless clicking on the focusable element first).
document.execCommand("cut");
document.execCommand("copy");
document.execCommand("paste");
This isn't really about whether an element is clicked but rather if the element has the selection or not. WebKit only fires the event on the selection's endpoints' common ancestor instead of the focused element. |