-
Notifications
You must be signed in to change notification settings - Fork 50.9k
Bug: (17.0.0-rc.0) Event propagation through portals is inconsistent #19608
Copy link
Copy link
Closed
Labels
Description
React version: 17.0.0-rc.0
Steps To Reproduce
- Open the codesandbox demo link below.
- Click on the
rootandportaldivs, check the logs. - Uncomment the
portaldiv'sonClickCapturenoop handler, check the logs again.
Link to code example: https://codesandbox.io/s/determined-montalcini-vjrgc?file=/src/App.js
The current behavior
Clicking on the portal div logs "portal click" only.
Adding an onClickCapture noop handler on the portal div "fixes" the root's onClickCapture handler.
You might have to refresh the page between edits, otherwise the root's onClickCapture handler might keep working even after removing the portal's onClickCapture handler.
The expected behavior
Clicking on the portal div should trigger the root's onClickCapture handler, whether the portal div has an onClickCapture handler or not.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Type
Fields
Give feedbackNo fields configured for issues without a type.