kopia lustrzana https://github.com/shoelace-style/shoelace
Merge branch 'next' into next
commit
289d0028ac
|
@ -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
|
||||
|
||||
|
|
|
@ -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)) {
|
||||
|
|
Ładowanie…
Reference in New Issue