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

HTMLElement.togglePopover can't close the popover when applied on <td> #10890

Open
LcsGa opened this issue Jan 3, 2025 · 1 comment
Open

Comments

@LcsGa
Copy link

LcsGa commented Jan 3, 2025

What is the issue with the HTML Standard?

I've been facing this weird issue where the togglePopover doesn't work when it is for closing the popover on a element (I don't know if it's the only element that has this issue though).

My popover is set to auto (by default) and I toggle it with that method (which always wroked well until then, but I may be missing something) (never faced any issue with popovertarget, that's what I mean).

After doing my best to debug it, I've found that the beforetoggle event is triggered twice (close then open) (but not the toggle one, strangely). => if I prevent the opening one (when concurrent with the closing one), then everything works find (this is my only workaround for now).

Here is a reproduction of the issue (and warkaround) https://codepen.io/lcsga/pen/wBwPeMY

If I forget to provide some other needed informations, let me know, I'd do my best to complete it asap!

@scottaohara
Copy link
Collaborator

i looked at your codepen and noticed you commented out the workaround. did you end up resolving your issue? i'm not having issues opening or closing the popovers in your test using mouse or keyboard? maybe i'm missing something.

but with that said - i'm not sure i really understand the use case here. why you wouldn't put a button within those TDs to mitigate the issue you're potentially facing / make this accessible for people using screen readers. TD elements (role=cell) don't support the expanded state in the a11y tree, so there'd be a lot of extra work needed to ensure this behavior would be properly conveyed to people using screen readers. That is, unless you nested button elements inside the TDs and used those to toggle the popovers - then no JS or extra ARIA for your buttons would be necessary.

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

No branches or pull requests

2 participants