optional chain disconnects; fixes #2127 (#2129)

sammyl720-auto-hide-tab-group-scroll-buttons
Cory LaViska 2024-08-05 08:46:30 -04:00 zatwierdzone przez GitHub
rodzic d0441f53ce
commit bc6d25acbc
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: B5690EEEBB952194
8 zmienionych plików z 12 dodań i 9 usunięć

Wyświetl plik

@ -12,6 +12,10 @@ Components with the <sl-badge variant="warning" pill>Experimental</sl-badge> bad
New versions of Shoelace are released as-needed and generally occur when a critical mass of changes have accumulated. At any time, you can see what's coming in the next release by visiting [next.shoelace.style](https://next.shoelace.style).
## Next
- Fixed a bug that caused errors to show in the console when components disconnect before before `firstUpdated()` executes [#2127]
## 2.16.0
- Added the Czech translation [#2084]

Wyświetl plik

@ -103,7 +103,7 @@ export default class SlCarousel extends ShoelaceElement {
disconnectedCallback(): void {
super.disconnectedCallback();
this.mutationObserver.disconnect();
this.mutationObserver?.disconnect();
}
protected firstUpdated(): void {

Wyświetl plik

@ -89,7 +89,7 @@ export default class SlDetails extends ShoelaceElement {
disconnectedCallback() {
super.disconnectedCallback();
this.detailsObserver.disconnect();
this.detailsObserver?.disconnect();
}
private handleSummaryClick(event: MouseEvent) {

Wyświetl plik

@ -132,7 +132,7 @@ export default class SlRange extends ShoelaceElement implements ShoelaceFormCont
disconnectedCallback() {
super.disconnectedCallback();
this.resizeObserver.unobserve(this.input);
this.resizeObserver?.unobserve(this.input);
}
private handleChange() {

Wyświetl plik

@ -85,7 +85,7 @@ export default class SlSplitPanel extends ShoelaceElement {
disconnectedCallback() {
super.disconnectedCallback();
this.resizeObserver.unobserve(this);
this.resizeObserver?.unobserve(this);
}
private detectSize() {

Wyświetl plik

@ -120,8 +120,8 @@ export default class SlTabGroup extends ShoelaceElement {
disconnectedCallback() {
super.disconnectedCallback();
this.mutationObserver.disconnect();
this.resizeObserver.unobserve(this.nav);
this.mutationObserver?.disconnect();
this.resizeObserver?.unobserve(this.nav);
}
private getAllTabs() {

Wyświetl plik

@ -164,7 +164,7 @@ export default class SlTextarea extends ShoelaceElement implements ShoelaceFormC
disconnectedCallback() {
super.disconnectedCallback();
if (this.input) {
this.resizeObserver.unobserve(this.input);
this.resizeObserver?.unobserve(this.input);
}
}

Wyświetl plik

@ -111,8 +111,7 @@ export default class SlTree extends ShoelaceElement {
disconnectedCallback() {
super.disconnectedCallback();
this.mutationObserver.disconnect();
this.mutationObserver?.disconnect();
}
// Generates a clone of the expand icon element to use for each tree item