-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 <[email protected]>
- Loading branch information
1 parent
c8865bb
commit 8241096
Showing
4 changed files
with
19 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'svelte': patch | ||
--- | ||
|
||
fix: treat `inert` as a boolean attribute |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 12 additions & 5 deletions
17
packages/svelte/tests/runtime-legacy/samples/attribute-boolean-inert/_config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,5 @@ | |
export let inert; | ||
</script> | ||
|
||
<div inert={false}></div> | ||
<div {inert}>some div <button>click</button></div> |