diff --git a/.changeset/quiet-planets-carry.md b/.changeset/quiet-planets-carry.md new file mode 100644 index 0000000000..0abeffa2e8 --- /dev/null +++ b/.changeset/quiet-planets-carry.md @@ -0,0 +1,5 @@ +--- +'svelte': patch +--- + +fix: treat `inert` as a boolean attribute diff --git a/packages/svelte/src/utils.js b/packages/svelte/src/utils.js index e42721b4f4..76486d32ac 100644 --- a/packages/svelte/src/utils.js +++ b/packages/svelte/src/utils.js @@ -156,6 +156,7 @@ const DOM_BOOLEAN_ATTRIBUTES = [ 'formnovalidate', 'hidden', 'indeterminate', + 'inert', 'ismap', 'loop', 'multiple', @@ -214,7 +215,6 @@ const DOM_PROPERTIES = [ 'playsInline', 'readOnly', 'value', - 'inert', 'volume', 'defaultValue', 'defaultChecked', diff --git a/packages/svelte/tests/runtime-legacy/samples/attribute-boolean-inert/_config.js b/packages/svelte/tests/runtime-legacy/samples/attribute-boolean-inert/_config.js index 1322d63b7a..26fbbc955b 100644 --- a/packages/svelte/tests/runtime-legacy/samples/attribute-boolean-inert/_config.js +++ b/packages/svelte/tests/runtime-legacy/samples/attribute-boolean-inert/_config.js @@ -1,14 +1,21 @@ -import { ok, test } from '../../test'; +import { test } from '../../test'; export default test({ + ssrHtml: ` +
+