fix: treat `inert` as a boolean attribute (#14935)

* fix: treat `inert` as a boolean attribute

fixes #14731

* remove solo: true

---------

Co-authored-by: Rich Harris <rich.harris@vercel.com>
pull/14938/head
Simon H 4 days ago committed by GitHub
parent c8865bb4a7
commit 8241096b06
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: treat `inert` as a boolean attribute

@ -156,6 +156,7 @@ const DOM_BOOLEAN_ATTRIBUTES = [
'formnovalidate', 'formnovalidate',
'hidden', 'hidden',
'indeterminate', 'indeterminate',
'inert',
'ismap', 'ismap',
'loop', 'loop',
'multiple', 'multiple',
@ -214,7 +215,6 @@ const DOM_PROPERTIES = [
'playsInline', 'playsInline',
'readOnly', 'readOnly',
'value', 'value',
'inert',
'volume', 'volume',
'defaultValue', 'defaultValue',
'defaultChecked', 'defaultChecked',

@ -1,14 +1,21 @@
import { ok, test } from '../../test'; import { test } from '../../test';
export default test({ export default test({
ssrHtml: `
<div></div>
<div inert="">some div <button>click</button></div>
`,
get props() { get props() {
return { inert: true }; return { inert: true };
}, },
test({ assert, target, component }) { test({ assert, target, component }) {
const div = target.querySelector('div'); const [div1, div2] = target.querySelectorAll('div');
ok(div); assert.ok(!div1.inert);
assert.ok(div.inert); assert.ok(div2.inert);
component.inert = false; component.inert = false;
assert.ok(!div.inert); assert.ok(!div2.inert);
} }
}); });

@ -2,4 +2,5 @@
export let inert; export let inert;
</script> </script>
<div inert={false}></div>
<div {inert}>some div <button>click</button></div> <div {inert}>some div <button>click</button></div>

Loading…
Cancel
Save