Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/quiet-planets-carry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'svelte': patch
---

fix: treat `inert` as a boolean attribute
2 changes: 1 addition & 1 deletion packages/svelte/src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ const DOM_BOOLEAN_ATTRIBUTES = [
'formnovalidate',
'hidden',
'indeterminate',
'inert',
'ismap',
'loop',
'multiple',
Expand Down Expand Up @@ -214,7 +215,6 @@ const DOM_PROPERTIES = [
'playsInline',
'readOnly',
'value',
'inert',
'volume',
'defaultValue',
'defaultChecked',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
import { ok, test } from '../../test';
import { test } from '../../test';

export default test({
ssrHtml: `
<div></div>
<div inert="">some div <button>click</button></div>
`,

get props() {
return { inert: true };
},

test({ assert, target, component }) {
const div = target.querySelector('div');
ok(div);
assert.ok(div.inert);
const [div1, div2] = target.querySelectorAll('div');
assert.ok(!div1.inert);
assert.ok(div2.inert);

component.inert = false;
assert.ok(!div.inert);
assert.ok(!div2.inert);
}
});
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
export let inert;
</script>

<div inert={false}></div>
<div {inert}>some div <button>click</button></div>
Loading