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

Extract useClickOutsideCallback hook from 2U #44

Open
lettertwo opened this issue Feb 27, 2020 · 0 comments
Open

Extract useClickOutsideCallback hook from 2U #44

lettertwo opened this issue Feb 27, 2020 · 0 comments

Comments

@lettertwo
Copy link
Contributor

Is your feature request related to a problem? Please describe.

UIs that present 'modal' or 'popover' behavior often overlook an important UX element—dismissing the overlay UI when the user tries to access the UI behind it.

2U has a hook that takes an element ref, and a callback, and then calls that callback whenever a click is detected outside of the element. This could be a building block for modal behaviors—a simple solution for an important detail that is easy to overlook.

Describe the solution you'd like

Extract and package useClickOutsideCallback from 2U

Describe alternatives you've considered

🤔

Additional context

  • doesn't have and docs or tests yet
  • peer dependencies
    • react
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants