Skip to content

Extract useClickOutsideCallback hook from 2U #44

@lettertwo

Description

@lettertwo

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions