chore: add test for binding event reactive context (#14522)

* chore: add test for binding event reactive context

* revised
pull/14528/head
Dominic Gannaway 9 months ago committed by GitHub
parent 3d36e15ddd
commit 94694a5e63
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -1,6 +1,6 @@
import { DEV } from 'esm-env';
import { render_effect, teardown } from '../../../reactivity/effects.js';
import { listen_to_event_and_reset_event, without_reactive_context } from './shared.js';
import { listen_to_event_and_reset_event } from './shared.js';
import * as e from '../../../errors.js';
import { is } from '../../../proxy.js';
import { queue_micro_task } from '../../task.js';

@ -0,0 +1,7 @@
import { test } from '../../test';
export default test({
test({ assert, logs }) {
assert.deepEqual(logs, [false]);
}
});

@ -0,0 +1,24 @@
<script>
let bar = $state('');
const foo = {
set bar(v) {
console.log($effect.tracking());
bar = v;
},
get bar() {
return bar;
}
}
let input;
$effect(() => {
input.value = 'everybody';
input.dispatchEvent(new window.Event('input'));
})
</script>
<input type="text" bind:value={foo.bar} bind:this={input}>
Loading…
Cancel
Save