Closed Bug 1166327 Opened 10 years ago Closed 6 years ago

Copy event doesn't seem to fire

Categories

(Firefox for Android Graveyard :: Text Selection, defect)

38 Branch
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 676268

People

(Reporter: brendan.berkley, Unassigned)

Details

User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.90 Safari/537.36 Steps to reproduce: http://jsfiddle.net/q2q57gkj/ Add some things to the 'copy' event. In my case I did a console log, event.preventDefault(), and an alert. Actual results: It copies the text to the clipboard. Expected results: It should have done a console log, prevented the text from being copied to the clipboard, and flashed an alert.
Following the reproduction steps mentioned in the description i could not reproduce the issue in the generated text field section. It is true that in the input sections, the copy action could be performed, but as i mentioned before in the generated field, upon pressing any word, the focus is moved to the menu field and a copy action cannot be performed. This issue was tested using a Xiaomi MI i4 device with Android 5.0.2 on the latest Nightly(44.0a1) build. Brendan, Could you please retest this on your device using the latest Nightly build in order to reproduce it? And also if missed any information in the repro-steps, please let me know and i will retest this issue. Thanks
Flags: needinfo?(brendan.berkley)
I reproduced it. https://youtu.be/kuAvb-b92Hc Mozilla/5.0 (Android 5.0.2; Mobile; rv:44.0) Gecko/44.0 Firefox/44.0 ASUS ZenFone Selfie ZD551KL (ASUS Z00UD)
Status: UNCONFIRMED → NEW
Ever confirmed: true
Today, I spent several hours trying to understand why my copy event is not firing in firefox for android v63.0.2 in android 6.0.1. Initially I thought my code is wrong so I tested these possible options: document.addEventListener('copy', function() { console.log("Copy detected");alert("Copy detected"); }); document.oncopy = function() { console.log("Copy detected");alert("Copy detected"); } $("body").bind('copy', function() { console.log("Copy detected");alert("Copy detected"); }); $("document").bind('copy', function() { console.log("Copy detected");alert("Copy detected"); }); but none of them worked! On the other side the onpaste event worked correctly: document.onpaste = function() { console.log("Paste detected");alert("Paste detected"); } Then I just tested the following line in chrome for android and it worked perfectly: document.addEventListener('copy', function() { console.log("Copy detected");alert("Copy detected"); }); So now I'm sure it is a bug. I'm very surprised this bug is reported 4 years ago and nobody cared to fixed it.

I believe that this is fixed by bug 676268 and bug 1537885. If not fixed, please reopen this bug.

Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → DUPLICATE
Flags: needinfo?(brendan.berkley)
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.