mirror of https://github.com/sveltejs/svelte
parent
8b1a26904a
commit
500b2065e0
@ -0,0 +1,5 @@
|
||||
---
|
||||
"svelte": patch
|
||||
---
|
||||
|
||||
fix: apply modifiers to bubbled events
|
@ -0,0 +1,12 @@
|
||||
import { ok, test } from '../../test';
|
||||
|
||||
export default test({
|
||||
async test({ assert, component, target }) {
|
||||
const button = target.querySelector('button');
|
||||
ok(button);
|
||||
|
||||
await button.click();
|
||||
|
||||
assert.ok(component.default_was_prevented);
|
||||
}
|
||||
});
|
@ -0,0 +1 @@
|
||||
<button on:click|preventDefault>click me</button>
|
@ -0,0 +1,11 @@
|
||||
<script>
|
||||
import Button from "./button.svelte";
|
||||
|
||||
export let default_was_prevented;
|
||||
|
||||
function handle_click(event) {
|
||||
default_was_prevented = event.defaultPrevented;
|
||||
}
|
||||
</script>
|
||||
|
||||
<Button on:click={handle_click} />
|
Loading…
Reference in new issue