-
-
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.
fixes #11328
- Loading branch information
Showing
3 changed files
with
34 additions
and
9 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
12 changes: 12 additions & 0 deletions
12
packages/svelte/tests/runtime-runes/samples/event-prop-current-target/_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,12 @@ | ||
import { test } from '../../test'; | ||
|
||
export default test({ | ||
async test({ assert, target, logs }) { | ||
const [s1] = target.querySelectorAll('span'); | ||
|
||
s1?.click(); | ||
await Promise.resolve(); | ||
|
||
assert.deepEqual(logs, [false]); | ||
} | ||
}); |
13 changes: 13 additions & 0 deletions
13
packages/svelte/tests/runtime-runes/samples/event-prop-current-target/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,13 @@ | ||
<script> | ||
function onclick(e) { | ||
// should log false when we click the span | ||
console.log(e.currentTarget === e.target) | ||
} | ||
</script> | ||
|
||
|
||
<button {onclick}> | ||
<span> | ||
Click me | ||
</span> | ||
</button> |