-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Comments
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. |
No I didn't find any other solution yet, I just commented it so that people testing it could see the issue right away. About your second point, you're completely right! My answer might not convince you (and for a good reason, because I simply avoid another problem) but I did it because the popover would not align correctly with mat-tables when the target is something within a cell, and not the cell itself... |
I'm not immediately sure what's wrong here, but this also reproduces if I replace the |
Nice to know! It might not be as niche as I first thought then!
|
I can also reproduce with
but not with |
By the way, reading you helped me rethink about it and I found a way better workaround for my use case:
=> no alignement issue anymore, no bug, no a11y issue! |
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<td>
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 thetoggle
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!
The text was updated successfully, but these errors were encountered: