fix: set `open` binding value in `<details>` (#10413)

* fix: set initial value for `open` binding in `<details>`

* accurate desc
pull/10417/head
Ahmad 11 months ago committed by GitHub
parent 76620e7d02
commit 89c4cf393f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: set `open` binding value in `<details>`

@ -175,6 +175,7 @@ export const binding_properties = {
textContent: {},
open: {
event: 'toggle',
type: 'set',
valid_elements: ['details']
},
value: {

@ -0,0 +1,11 @@
import { ok, test } from '../../test';
export default test({
test({ assert, target }) {
const details_el = target.querySelector('details');
ok(details_el);
assert.strictEqual(details_el.open, true);
}
});

@ -0,0 +1,8 @@
<script>
let open = $state(true);
</script>
<details bind:open>
<summary>Details</summary>
...
</details>
Loading…
Cancel
Save