From 643c5a171238420e2378c302106769f85e0abc5c Mon Sep 17 00:00:00 2001 From: Sondre H Elgaaen Date: Thu, 15 Aug 2024 18:05:14 +0200 Subject: [PATCH] fix: add condition on select Fixed conditionDiv such that condition is added to the condition view when clicking enter or selecting the condition from the dropdown. Check for enter also added to conditionDiv to ensure the same behaviour holds true for custom/improvised conditions. --- src/tracker/ui/Updating.svelte | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/tracker/ui/Updating.svelte b/src/tracker/ui/Updating.svelte index b067271..ce65859 100644 --- a/src/tracker/ui/Updating.svelte +++ b/src/tracker/ui/Updating.svelte @@ -67,6 +67,10 @@ const conditionDiv = (node: HTMLElement) => { conditionText = new TextComponent(node); conditionText.onChange((v) => (status = v)); + node.onkeydown = (evt) => { + if (evt.key === "Enter") { + status ? addStatus() : performUpdate(true); + }}; createModal(); }; const createModal = () => { @@ -82,6 +86,7 @@ conditionText.setValue(item); modal.close(); + addStatus(); }); }; function init(el: HTMLInputElement, target: "hp" | "ac") {