When the first or last focusable element in a core-dialog is a link it is impossible to focus using tab or shift + tab.
In addition if the first focusable element in a core-dialog is a link it does not get autofocused when the dialog is opened.
This is because the isVisible() test in core-dialog.js checks if el.clientWidth and el.clientHeight is greater than 0 to determine if the element is visible, but this is always 0 for inline elements such as links according to the spec.
I can make a PR and maybe use el.getBoundingClientRect() instead but I'm not entirely sure why this function checks el.clientWidth and el.clientHeight. Even buttons can have width/height/padding of 0 and still be interactive as far as I know, especially without overflow: hidden, although this is not a good practice of course.
Testcase: https://codesandbox.io/s/core-dialog-impossible-to-focus-first-or-last-link-in-dialog-using-tab-lo8hp
When the first or last focusable element in a core-dialog is a link it is impossible to focus using tab or shift + tab.
In addition if the first focusable element in a core-dialog is a link it does not get autofocused when the dialog is opened.
This is because the isVisible() test in
core-dialog.js
checks ifel.clientWidth
andel.clientHeight
is greater than0
to determine if the element is visible, but this is always0
for inline elements such as links according to the spec.I can make a PR and maybe use
el.getBoundingClientRect()
instead but I'm not entirely sure why this function checksel.clientWidth
andel.clientHeight
. Even buttons can have width/height/padding of 0 and still be interactive as far as I know, especially withoutoverflow: hidden
, although this is not a good practice of course.