-
-
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: add check for is attribute (#15086)
Fixes #15085 Add a check for is attribute in is_custom_element_node function.
- Loading branch information
1 parent
7740d45
commit d17f5c7
Showing
6 changed files
with
35 additions
and
4 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: add check for `is` attribute to correctly detect custom elements |
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
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
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
19 changes: 19 additions & 0 deletions
19
packages/svelte/tests/runtime-runes/samples/custom-element-attributes/_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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { test } from '../../test'; | ||
|
||
export default test({ | ||
mode: ['client', 'server'], | ||
async test({ assert, target }) { | ||
const my_element = /** @type HTMLElement & { object: { test: true }; } */ ( | ||
target.querySelector('my-element') | ||
); | ||
const my_link = /** @type HTMLAnchorElement & { object: { test: true }; } */ ( | ||
target.querySelector('a') | ||
); | ||
assert.equal(my_element.getAttribute('string'), 'test'); | ||
assert.equal(my_element.hasAttribute('object'), false); | ||
assert.deepEqual(my_element.object, { test: true }); | ||
assert.equal(my_link.getAttribute('string'), 'test'); | ||
assert.equal(my_link.hasAttribute('object'), false); | ||
assert.deepEqual(my_link.object, { test: true }); | ||
} | ||
}); |
2 changes: 2 additions & 0 deletions
2
packages/svelte/tests/runtime-runes/samples/custom-element-attributes/main.svelte
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,2 @@ | ||
<my-element string="test" object={{ test: true }}></my-element> | ||
<a is="my-link" string="test" object={{ test: true }}></a> |