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

Implement useEscClose and useOutsideClickClose hooks #156

Open
ilyasidorchik opened this issue Jul 7, 2022 · 0 comments
Open

Implement useEscClose and useOutsideClickClose hooks #156

ilyasidorchik opened this issue Jul 7, 2022 · 0 comments
Labels

Comments

@ilyasidorchik
Copy link

ilyasidorchik commented Jul 7, 2022

Motivation

  • Remove useless code.
    Example. Tooltip Popup. It opens when the hint (?) element receives keyboard focus or the mouse hovers over it. It disappears on focus or mouse out. It would be better to use useEscClose only instead of useOverlay.
  • Remove useless option.
    Example. Full-screen Modal Popup. It would be better to use useOutsideClickClose only instead of useOverlay .

Draft API

I see two ways:

  1. Make new hooks and use it in useOverlay.
  2. Add closing options to useOverlay.

A11y

Example of simple tooltip: w3c/aria-practices#127 (comment)

References

Arcanum. Market. Full-screen Modal Popup (internal link)

WAI ARIA. Pattern Tooltip Widget
WAI ARIA. Pattern Dialog

Integration

useOverlay

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

No branches or pull requests

1 participant