diff --git a/docs/docs/resources/changelog.md b/docs/docs/resources/changelog.md index 39d6be02f..c379f0665 100644 --- a/docs/docs/resources/changelog.md +++ b/docs/docs/resources/changelog.md @@ -29,6 +29,7 @@ During the alpha period, things might break! We take breaking changes very serio - Fixed a bug in `` that prevented label changes in `` from updating the controller - Fixed a bug in `` that caused interactive elements to be activated when dragging - Fixed a bug in `` that prevented changing tabs by setting `active` on `` elements +- Fixed a bug in `` that caused an error when removed from the DOM too quickly - Fixed a bug in `` causing scroll jumping when using `resize="auto"` - Fixed a bug with certain bundlers when using dynamic imports - Improved alignment of the play icon in `` @@ -45,8 +46,8 @@ During the alpha period, things might break! We take breaking changes very serio - Fixed a bug in `` that made the suffix slot collide with the clear button - Fixed a bug in `` where unchecking and then checking would "clear" its value. - Fixed a bug where `` would announce the full time instead of the relative time in screen readers [#22](https://github.com/shoelace-style/webawesome-alpha/issues/22) -- Fixed a bug in `` in Firefox where the overflow container would keep focus. [#14](https://github.com/shoelace-style/webawesome-alpha/issues/14) -- Fixed a bug in `` where `minlength` and `maxlength` were not being properly validated. [#35](https://github.com/shoelace-style/webawesome-alpha/issues/35) +- Fixed a bug in `` in Firefox where the overflow container would keep focus [#14](https://github.com/shoelace-style/webawesome-alpha/issues/14) +- Fixed a bug in `` where `minlength` and `maxlength` were not being properly validated [#35](https://github.com/shoelace-style/webawesome-alpha/issues/35) - Fixed a bug in `` that made pagination work incorrectly ## 3.0.0-alpha.2 @@ -78,7 +79,7 @@ Here's a list of some of the things that have changed since Shoelace v2. For que - Changed the `data-optional`, `data-required`, `data-invalid`, `data-valid`, `data-user-invalid`, and `data-user-valid` states to `data-wa-*` prefix to avoid conflicts with user provided attributes - Changed `` so icons are no longer fixed width by default to accommodate variable width icons - Changed `` from `display: block;` to `display: inline-block` -- Changed `` to implement a "roving tabindex" and `` is no longer tabbable by default. This aligns closer to the APG pattern for tabs. [#2041] +- Changed `` to implement a "roving tabindex" and `` is no longer tabbable by default. This aligns closer to the APG pattern for tabs [#2041] - Changed `` to no longer wrap content due to accessibility and styling issues. Tooltips are now associated using the `for` attribute + an `id` on the trigger [#123] - Improved `` so it doesn't wobble when zooming in Safari - Improved submenu selection by implementing the [safe triangle](https://www.smashingmagazine.com/2023/08/better-context-menus-safe-triangles/) method [#1550] diff --git a/src/components/tab-group/tab-group.test.ts b/src/components/tab-group/tab-group.test.ts index 3f1f12570..f88f07540 100644 --- a/src/components/tab-group/tab-group.test.ts +++ b/src/components/tab-group/tab-group.test.ts @@ -86,6 +86,13 @@ describe('', () => { expect(tabGroup).to.be.visible; }); + it('should not throw error when unmounted too fast', async () => { + const el = await fixture(html`
`); + + el.innerHTML = ''; + el.innerHTML = ''; + }); + it('is accessible', async () => { const tabGroup = await fixture(html` diff --git a/src/components/tab-group/tab-group.ts b/src/components/tab-group/tab-group.ts index 80f2e3498..4b1af0a21 100644 --- a/src/components/tab-group/tab-group.ts +++ b/src/components/tab-group/tab-group.ts @@ -139,7 +139,10 @@ export default class WaTabGroup extends WebAwesomeElement { disconnectedCallback() { super.disconnectedCallback(); this.mutationObserver?.disconnect(); - this.resizeObserver?.unobserve(this.nav); + + if (this.nav) { + this.resizeObserver?.unobserve(this.nav); + } } private getAllTabs() {