mirror of https://github.com/sveltejs/svelte
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
parent
c8865bb4a7
commit
8241096b06
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
'svelte': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
fix: treat `inert` as a boolean attribute
|
@ -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);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in new issue