Skip to content
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

[EuiOverlayMask] Remove onClick in favor of EuiFocusTrap combo #6016

Closed
thompsongl opened this issue Jun 30, 2022 · 0 comments · Fixed by #6090
Closed

[EuiOverlayMask] Remove onClick in favor of EuiFocusTrap combo #6016

thompsongl opened this issue Jun 30, 2022 · 0 comments · Fixed by #6090

Comments

@thompsongl
Copy link
Contributor

EuiOverlayMask <-- we've had issues in the past with click events on our overlay mask that Greg had to fix, and I'm a little worried about this potentially reintroducing bugs.

Willing to hear arguments against, but I think that EuiOverlayMask should no longer accept an onClick prop. The intention was to give an easy on-outside-click hook, but this is now inconsistent with our other approaches to outside click behavior, which have largely been standardized.

If it's necessary to unblock your React 17 PR, we can add the isCapture prop or prioritize the breaking change to remove onClick.

The suggestion would then be to use EuiFocusTrap in conjunction with EuiOverlayMask as we do in several components (e.g., EuiFlyout and EuiCodeBlock):

<EuiOverlayMask>
  <EuiFocusTrap onClickOutside={onClick} />
</EuiOverlayMask>

Originally posted by @thompsongl in #5940 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant