fix focus trap when open on init

pull/479/head
Cory LaViska 2021-06-28 16:49:56 -04:00
rodzic d4d581e4fb
commit d6eeacbdc1
3 zmienionych plików z 11 dodań i 0 usunięć

Wyświetl plik

@ -20,6 +20,7 @@ The docs have been updated to use the new `custom-elements.json` file. If you're
- Added `sl-request-close` event to `sl-dialog` and `sl-drawer`
- Added `dialog.denyClose` and `drawer.denyClose` animations
- Fixed a bug in `sl-color-picker` where setting `value` immediately wouldn't trigger an update
- Fixed a bug in `sl-dialog` and `sl-drawer` where setting `open` intially didn't set a focus trap
- Fixed a bug that resulted in form controls having incorrect validity when `disabled` was initially set [#473](https://github.com/shoelace-style/shoelace/issues/473)
- Fixed a bug in the docs that caused the metadata file to be requested twice
- Updated the docs to use the new `custom-elements.json` for component metadata

Wyświetl plik

@ -95,6 +95,11 @@ export default class SlDialog extends LitElement {
firstUpdated() {
this.dialog.hidden = !this.open;
if (this.open) {
this.modal.activate();
lockBodyScrolling(this);
}
}
disconnectedCallback() {

Wyświetl plik

@ -112,6 +112,11 @@ export default class SlDrawer extends LitElement {
firstUpdated() {
this.drawer.hidden = !this.open;
if (this.open && !this.contained) {
this.modal.activate();
lockBodyScrolling(this);
}
}
disconnectedCallback() {