'html paste handler wont trigger on a element
In below html code snippet, paste-element is not enabled for paste when called .focus on it, can any html expert help me why it wont work this way.
<!DOCTYPE html>
<html>
<body>
<h1>Display Text Input Fields</h1>
<div id="paste-element" tabindex="0" onpaste="alert(1)" > --> Clicking or tab into this will enable element for paste
paste here
</div>
<p onclick="document.getElementById('paste-element').focus()">Click here, wont enable paste</p>
</body>
</html>
Same question is being discussed in react forum - https://github.com/facebook/react/issues/9769
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
