mirror of
https://github.com/shoelace-style/webawesome.git
synced 2026-01-12 04:09:12 +00:00
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:
@@ -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>
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user