You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Do you want to request a feature or report a bug?
BUG What is the current behavior?
When setting up an onPaste handler, react provides two choices: onPaste, or onPasteCapture. In both cases, the DOM event.currentTarget is the #document (which is reasonable given how react's delegate behavior works), but the eventPhase is 3 (aka bubbling) in BOTH cases.
What is the expected behavior?
Expected is that onPasteCapture fires when the DOM event is in the capture phase. This is needed to be able to manipulate the paste handler properly when playing focus games on Edge
Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?
Latest version of React, affects at least Chrome and Edge, but I suspect it is browser/OS independent.
The text was updated successfully, but these errors were encountered:
React uses one global event handler per event type and for paste event this handler is always called in bubbling phase in DOM (might be capture for some other event types).
As for eventPhase property on SyntheticEvent it looks like React juts copies native event's eventPhase onto SyntheticEvent (therefore will be always 3 in this case). Then it gathers all the handlers into event._dispatchListeners simulating capture/bubble phases to get them. Those events will be later run in event queue which does not know at this point in which (synthetic) phrase the handler was gathered. This works the same for other events too. When reimplementing event system, it does not change this value accordingly when calling provided callbacks.
We do listen for some events during the capture phase, so it should be possible to handle the event during the correct phase. I'll have to look into it more 🤔
Do you want to request a feature or report a bug?
BUG
What is the current behavior?
When setting up an
onPaste
handler, react provides two choices:onPaste
, oronPasteCapture
. In both cases, the DOM event.currentTarget is the #document (which is reasonable given how react's delegate behavior works), but theeventPhase
is3
(aka bubbling) in BOTH cases.**If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://jsfiddle.net or similar
http://jsbin.com/dacolavipe/edit?js,console,output
What is the expected behavior?
Expected is that
onPasteCapture
fires when the DOM event is in the capture phase. This is needed to be able to manipulate the paste handler properly when playing focus games on EdgeWhich versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?
Latest version of React, affects at least Chrome and Edge, but I suspect it is browser/OS independent.
The text was updated successfully, but these errors were encountered: