Merge branch 'next' into next

pull/2359/head
Cory LaViska 2025-02-03 14:26:19 -05:00 zatwierdzone przez GitHub
commit 289d0028ac
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: B5690EEEBB952194
2 zmienionych plików z 14 dodań i 3 usunięć

Wyświetl plik

@ -18,6 +18,7 @@ New versions of Shoelace are released as-needed and generally occur when a criti
- Updated the Japanese translation [#2329]
- Adjust `<sl-alert>` to create the toast stack when used only, making it usable in SSR environments. [#2359]
- Adjust `scrollend-polyfill` so it only runs on the client to make it usable in SSR environments. [#2359]
- Fixed a bug with radios in `<sl-dialog>` focus trapping.
## 2.19.1

Wyświetl plik

@ -80,9 +80,19 @@ function isTabbable(el: HTMLElement) {
return false;
}
// Radios without a checked attribute are not tabbable
if (tag === 'input' && el.getAttribute('type') === 'radio' && !el.hasAttribute('checked')) {
return false;
if (tag === 'input' && el.getAttribute('type') === 'radio') {
const rootNode = el.getRootNode() as HTMLElement;
const findRadios = `input[type='radio'][name="${el.getAttribute('name')}"]`;
const firstChecked = rootNode.querySelector(`${findRadios}:checked`);
if (firstChecked) {
return firstChecked === el;
}
const firstRadio = rootNode.querySelector(findRadios);
return firstRadio === el;
}
if (!isVisible(el)) {