NEW 165248
paste event not triggered when using html + svg elements
https://bugs.webkit.org/show_bug.cgi?id=165248
Summary paste event not triggered when using html + svg elements
Nicu Micleușanu
Reported 2016-12-01 01:54:38 PST
It is impossible to trigger paste in this case: ``` var div = document.createElement('div'); var svg = document.createElementNS("http://www.w3.org/2000/svg","svg"); div.appendChild(svg); div.tabIndex = -1; div.style.backgroundColor = '#EEEEFF'; div.style.height = '200px'; div.addEventListener('paste', function(event) { // This event listener is not triggered console.log('paste: ', event.clipboardData.getData('text')); }); document.body.appendChild(div); ``` This happens when there is a html element with a svg child element or when there is a html element with a svg child element + a html child element without any content (if it has content it works fine).
Attachments
Nicu Micleușanu
Comment 1 2016-12-01 01:59:10 PST
Chris Dumez
Comment 2 2016-12-08 16:15:44 PST
(In reply to comment #1) > For testing: https://jsfiddle.net/etmo8rL5/ Test case seems to work in Firefox but fails in Chrome.
Ahmad Saleem
Comment 3 2024-01-02 10:14:32 PST
This is reproducible in Safari 17.2.1 and Chrome Canary 122. While it works fine in Firefox Nightly 123 where console logs: > "paste: ", "https://jsfiddle.net/etmo8rL5/" Just wanted to share up-to-date results. Should we add it to 'Radar'?
Note You need to log in before you can comment on or make changes to this bug.