diff --git a/package.json b/package.json index 0bd088c..1826113 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,7 @@ "eslint": "^8.56.0", "playwright": "^1.41.2", "typescript": "^5.3.3", - "vite": "^5.1.1", + "vite": "^5.1.2", "vitepress": "1.0.0-rc.42", "vitest": "^1.2.2", "vue": "^3.4.19", diff --git a/packages/core/package.json b/packages/core/package.json index fa0a8ea..9a72333 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -70,7 +70,7 @@ "fast-glob": "^3.3.2", "lightningcss": "^1.23.0", "typescript": "^5.3.3", - "vite": "^5.1.1", + "vite": "^5.1.2", "vite-plugin-dts": "^3.7.2" } } diff --git a/packages/core/src/components/drilldown.ts b/packages/core/src/components/drilldown.ts index b753df1..6e350b7 100644 --- a/packages/core/src/components/drilldown.ts +++ b/packages/core/src/components/drilldown.ts @@ -392,12 +392,10 @@ export default class Drilldown extends Parent { nexts.forEach((next) => { next.removeAttribute('role') next.removeAttribute('aria-expanded') - if (!next.getAttribute('aria-controls')) { - const menu = next.parentElement?.querySelector('.c-drilldown-menu') - next.removeAttribute('aria-controls') - if (menu && menu.id.startsWith('c-')) - menu.removeAttribute('id') - } + next.removeAttribute('aria-controls') + const menu = next.parentElement?.querySelector('.c-drilldown-menu') + if (menu && menu.id.startsWith('c-id-')) + menu.removeAttribute('id') }) const elsBeenDisable = this.el.querySelectorAll('[data-c-hidden]') elsBeenDisable.forEach((el) => { diff --git a/packages/core/src/components/dropdown.ts b/packages/core/src/components/dropdown.ts index f5c14c8..0797dde 100644 --- a/packages/core/src/components/dropdown.ts +++ b/packages/core/src/components/dropdown.ts @@ -324,7 +324,7 @@ export default class Dropdown extends Parent { this.triggerEl.removeAttribute('aria-controls') } - if (this.menuEl && this.menuEl.id.startsWith('c-')) + if (this.menuEl && this.menuEl.id.startsWith('c-id-')) this.menuEl.removeAttribute('id') if (this.type === 'menu' && this.menuEl) { diff --git a/packages/core/test/__snapshots__/collapse.test.ts.snap b/packages/core/test/__snapshots__/collapse.test.ts.snap new file mode 100644 index 0000000..e330c83 --- /dev/null +++ b/packages/core/test/__snapshots__/collapse.test.ts.snap @@ -0,0 +1,32 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`collapse > destroy 1`] = ` +"
+ + + ++ Lorem ipsum dolor sit amet consectetur, adipisicing elit. Mollitia facere possimus impedit facilis culpa illo earum deserunt consequuntur minus. Ad et qui labore reprehenderit magnam exercitationem placeat magni nesciunt suscipit. +
+Lorem ipsum dolor sit amet consectetur adipisicing elit. Consequatur, id? Dolorum cum est ipsum praesentium mollitia quod saepe nemo doloribus, aliquid dolore laudantium consequuntur alias facere veritatis magni, adipisci fugit.
+Lorem ipsum dolor sit, amet consectetur adipisicing elit. Pariatur, est dolore. Vel ducimus incidunt labore, ipsum necessitatibus omnis qui! Consectetur molestiae ipsam repellendus illum hic veritatis. Consequuntur impedit animi voluptatum.
+