pull/2196/head
Richard Harris 7 years ago
parent 87b6e17947
commit 21b063840d

@ -162,9 +162,8 @@
editor.on('change', instance => { editor.on('change', instance => {
if (!updating_externally) { if (!updating_externally) {
updating_externally = true; const value = instance.getValue();
// code = instance.getValue(); dispatch('change', { value });
dispatch('change', { value: instance.getValue() });
} }
}); });

@ -28,6 +28,9 @@
if (match && match[2]) $selected.type = match[2]; if (match && match[2]) $selected.type = match[2];
editing = null; editing = null;
// re-select, in case the type changed
handle_select($selected);
components = components; // TODO necessary? components = components; // TODO necessary?
} }
@ -43,7 +46,7 @@
console.error(`Could not find component! That's... odd`); console.error(`Could not find component! That's... odd`);
} }
selected.set($components[index] || $components[$components.length - 1]); handle_select($components[index] || $components[$components.length - 1]);
} }
} }
@ -70,7 +73,7 @@
}); });
components.update(components => components.concat(component)); components.update(components => components.concat(component));
selected.set(component); handle_select(component);
} }
</script> </script>
@ -193,7 +196,7 @@
spellcheck={false} spellcheck={false}
bind:value={editing.name} bind:value={editing.name}
on:focus={selectInput} on:focus={selectInput}
on:blur="{() => closeEdit()}" on:blur={closeEdit}
use:enter="{e => e.target.blur()}" use:enter="{e => e.target.blur()}"
> >
{:else} {:else}

Loading…
Cancel
Save