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

Introduce bindTriggerClose #111

Open
nathggns opened this issue Sep 20, 2022 · 2 comments
Open

Introduce bindTriggerClose #111

nathggns opened this issue Sep 20, 2022 · 2 comments

Comments

@nathggns
Copy link

We currently have both bindTrigger and bindToggle which open the popup and toggle the popup, but no equivalent to bindTrigger which will always close the popup. Is there a reason for this that I'm missing? It seems if bindTrigger is necessary that bindTriggerClose (or bindClose, or whatever) are also necessary. Has any consideration been given to introducing it? Or should we just always use bindToggle?

Thank you for the fantastic project!

@jedwards1211
Copy link
Member

Well, if you want an element to close the popup on click, just pass onClick={popupState.close} to it. I'm not sure if there are any relevant aria properties to pass to the element?

@nathggns
Copy link
Author

That wouldn't also do onTouchStart. You could definitely manually add both listeners, just thought it was likely there would be relevant aria properties too.

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

No branches or pull requests

2 participants