fix spurious input change in AString automerge component

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

@ -20,7 +20,18 @@
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) => {
if (previous_val!=temp_val)
dispatch('updateText', { dispatch('updateText', {
s: event.target.value, s: event.target.value,
p: [path] p: [path]
@ -29,4 +40,4 @@
</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