Fix wa-details accordion behavior in react (#1538)

* fix wa-details accordion in react (#1534)

* Update packages/webawesome/src/components/details/details.test.ts

Co-authored-by: Cory LaViska <cory@abeautifulsite.net>

* Remove unused import

* Fix unintended indent

---------

Co-authored-by: Cory LaViska <cory@abeautifulsite.net>
This commit is contained in:
Jason Polete
2025-10-13 10:40:35 -04:00
committed by GitHub
parent 0b45173192
commit 51253650e1
2 changed files with 8 additions and 1 deletions

View File

@@ -24,6 +24,13 @@ describe('<wa-details>', () => {
});
});
it('should reflect the name property', async () => {
const el = await fixture<WaDetails>(html`<wa-details></wa-details>`);
el.name = 'test'
await el.updateComplete;
expect(el.getAttribute('name')).to.equal('test');
});
it('should be visible with the open attribute', async () => {
const el = await fixture<WaDetails>(html`
<wa-details open>

View File

@@ -70,7 +70,7 @@ export default class WaDetails extends WebAwesomeElement {
@property() summary: string;
/** Groups related details elements. When one opens, others with the same name will close. */
@property() name: string;
@property({ reflect: true }) name: string;
/** Disables the details so it can't be toggled. */
@property({ type: Boolean, reflect: true }) disabled = false;