Issue metadata
Sign in to add a comment
|
"beforecopy" event doesn't triggered on no-text DOM elements
Reported by
p_bal...@setka.io,
Aug 17 2017
|
||||||||||||||||||||||
Issue descriptionUserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36 Steps to reproduce the problem: 1. Create no-text DOM element (for example DIV) 2. Add possibility to DOM focus to this element with adding attribute tabindex="-1" 3. Add event listener to "beforecopy" event 4. Add this element in focus 5. Try to copy it (via cmd+C) What is the expected behavior? "beforecopy" event should be triggered What went wrong? "beforecopy" event doesn't triggered Did this work before? Yes 59 Chrome version: 60.0.3112.90 Channel: n/a OS Version: OS X 10.12.2 Flash Version: "beforecopy" event triggered in v.59 and older versions of Chrom as well. But after updated my browser to v.60 this event works on text-elements only.
,
Aug 18 2017
@p_baluev-- Thanks for reporting the issue . Could you please provide us a sample test file/jsfiddle to reproduce the issue , along with the expected and actual result screenshots , which would help us in better understnding. Thanks!
,
Aug 21 2017
Per #c2, please provide sample HTML to reproduce this. Thanks! Note: It seems #c1 steps to try to copy collapsed selection, to copy something into clipboard, selection should be range selection.
,
Aug 22 2017
I created source of problem prototype ( https://jsfiddle.net/1efhv3sm/ ). There are contenteditable paragraph and figure element with nested div, img and figcaption inside. So you can click on each element and see in red-bordered area what element is focus right now. Alike this I log tagName of element on which the "beforecopy" event is called. IN CHROME V.60.0.3112.90 So. At first I clicked on paragraph and try to copy it (via cmd+C) Result log: > focused on P > "beforecopy" on P As expected. Then I try to click and copy figure and each nested element (div, img) Result log: > focused on FIGURE > "beforecopy" on IMG > focused on DIV > "beforecopy" on IMG > focused on IMG [And right here I expected "beforecopy" call on IMG, but this is not] IN CHROME V.60.0.3112.101 The result of this procedure with paragraph is exactly the same as in Chrome v.60.0.3112.90. Then I try to click and copy figure and each nested element (div, img) Result log: > focused on FIGURE > "beforecopy" on IMG > focused on DIV > "beforecopy" on IMG > focused on IMG > "beforecopy" on IMG [ this is absent in v.60.0.3112.90 ] So you can see strange behavior: while IMG element stay in focus and I trying to copy it "beforecopy" event doesn’t triggered in Chrome v.60.0.3112.90. Also I noticed another strange moment (in v.60.0.3112.101). If I try to reproduce procedure: 1. click on paragraph 2. click on img 3. copy img (cmd + C) Result log will be: > focused on P > focused on IMG > "beforecopy" on P [And I expected not P but IMG]
,
Aug 22 2017
Thank you for providing more feedback. Adding requester "hdodda@chromium.org" to the cc list and removing "Needs-Feedback" label. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Aug 23 2017
Mark WontFix since it works as expected. "beforecopy" event is dispatched to a node at selection start or BODY if selection is none. Note: "beforecopy" isn't standard event. |
|||||||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||||||
Comment 1 by tkent@chromium.org
, Aug 17 2017Labels: Needs-Bisect