fix spurious input change in AString automerge component

master
Niko PLP 4 months ago
parent c38585f87d
commit 5155dc208b
  1. 21
      ng-app/src/apps/automerge/AString.svelte

@ -20,13 +20,24 @@
export let path; export let path;
function update() {
temp_val = value;
previous_val = value;
}
let temp_val;
let previous_val;
$: value, update();
const change = (event) => { const change = (event) => {
dispatch('updateText', {
s: event.target.value, if (previous_val!=temp_val)
p: [path] dispatch('updateText', {
}); s: event.target.value,
p: [path]
});
} }
</script> </script>
<Input bind:value={value} on:keyup={change} type="text" placeholder="Enter some text" /> <Input bind:value={temp_val} on:keyup={change} type="text" placeholder="Enter some text" />
Loading…
Cancel
Save