-
Notifications
You must be signed in to change notification settings - Fork 839
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix React@17 event delegation #5940
Conversation
Preview documentation changes for this PR: https://eui.elastic.co/pr_5940/ |
7 similar comments
Preview documentation changes for this PR: https://eui.elastic.co/pr_5940/ |
Preview documentation changes for this PR: https://eui.elastic.co/pr_5940/ |
Preview documentation changes for this PR: https://eui.elastic.co/pr_5940/ |
Preview documentation changes for this PR: https://eui.elastic.co/pr_5940/ |
Preview documentation changes for this PR: https://eui.elastic.co/pr_5940/ |
Preview documentation changes for this PR: https://eui.elastic.co/pr_5940/ |
Preview documentation changes for this PR: https://eui.elastic.co/pr_5940/ |
e1a8219
to
78be407
Compare
Preview documentation changes for this PR: https://eui.elastic.co/pr_5940/ |
Makes sense given the use case, but I'm still trying to work out whether there are further/unintended consequences. Anything coming to mind for you, @chandlerprall? |
It wouldn't surprise me if there's an app somewhere that has a I don't think it makes sense to move the resize or scroll events into the capture phase? |
I'm also a little worried about possible unintended changes as a result of this fix. I'm wondering if it makes more sense to make this a prop that sets the |
Preview documentation changes for this PR: https://eui.elastic.co/pr_5940/ |
Thanks for the Could we potentially scope this PR down further to only affect specific desired components that you need? For example:
Let me know what you think! |
Willing to hear arguments against, but I think that If it's necessary to unblock your React 17 PR, we can add the The suggestion would then be to use <EuiOverlayMask>
<EuiFocusTrap onClickOutside={onClick} />
</EuiOverlayMask> I'll open an issue for ^ reglardless |
Preview documentation changes for this PR: https://eui.elastic.co/pr_5940/ |
Preview documentation changes for this PR: https://eui.elastic.co/pr_5940/ |
# Conflicts: # src/components/suggest/__snapshots__/suggest.test.tsx.snap
Preview documentation changes for this PR: https://eui.elastic.co/pr_5940/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @patrykkopycinski!
The change to EuiOverlayMask
LGTM
Could we potentially scope this PR down further to only affect specific desired components that you need?
I'd like to see this as well. Do you specifically need the configuration for EuiPopover
and EuiSelectable
?
@thompsongl I believe so, if I recall correctly we need that for Lens flyout |
@patrykkopycinski can you be a bit more specific about what in the Lens flyout requires either an |
Hey @patrykkopycinski I see that elastic/kibana#128239 has already merged. Are these EUI changes still wanted/required? |
Hey @patrykkopycinski - we're closing this PR due to staleness, but if you still need this behavior, please feel free to re-open this PR without changes to |
Summary
This PR fixes the issue discovered here elastic/kibana#128239 (comment)
In React@17 there were changes made to the Event delegation described here https://reactjs.org/blog/2020/08/10/react-v17-rc.html#changes-to-event-delegation
In
Canvas/Lens
app we are usingstopPropagation()
which in React@17 preventsEuiFocusTrap
,EuiOutsideClickDetector
to receive the events, so that PR aims to fix it by adding{ capture: true }
to force the event listeners to receive the event despite thestopPropagation()
Checklist