mirror of https://github.com/sveltejs/svelte
fix: parse ongotpointercapture and onlostpointercapture events correctly (#11790)
Fixes #11789pull/11795/head
parent
0c4c2b023c
commit
b963e53fc9
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
'svelte': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
fix: parse ongotpointercapture and onlostpointercapture events correctly
|
@ -0,0 +1,16 @@
|
|||||||
|
import { tick } from 'svelte';
|
||||||
|
import { test } from '../../assert';
|
||||||
|
|
||||||
|
export default test({
|
||||||
|
async test({ assert, window }) {
|
||||||
|
const div = window.document.querySelector('div');
|
||||||
|
|
||||||
|
div?.dispatchEvent(new PointerEvent('gotpointercapture'));
|
||||||
|
div?.dispatchEvent(new PointerEvent('lostpointercapture'));
|
||||||
|
|
||||||
|
await tick();
|
||||||
|
|
||||||
|
assert.equal(div?.dataset.lostCaptured, 'true');
|
||||||
|
assert.equal(div?.dataset.gotCaptured, 'true');
|
||||||
|
}
|
||||||
|
});
|
@ -0,0 +1,13 @@
|
|||||||
|
<script>
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div
|
||||||
|
ongotpointercapture={(e) => {
|
||||||
|
e.target.dataset.gotCaptured = "true";
|
||||||
|
}}
|
||||||
|
onlostpointercapture={(e) => {
|
||||||
|
e.target.dataset.lostCaptured = "true";
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
|
Loading…
Reference in new issue