From d7cab6461f53c18dcfa8b046bae94c0e296f75bd Mon Sep 17 00:00:00 2001 From: lilydjwg Date: Tue, 12 Oct 2021 18:58:42 +0800 Subject: [PATCH] better way to hide completion list --- src/Name.svelte | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/src/Name.svelte b/src/Name.svelte index 2e6c4f2..6b55495 100644 --- a/src/Name.svelte +++ b/src/Name.svelte @@ -54,16 +54,6 @@ } } - $: { - if(ul) { - if(names.length === 0 || (!has_focus && !has_mouse)) { - ul.style.display = 'none' - }else{ - ul.style.display = 'block' - } - } - } - function select_by_click(e) { let el = e.target if(el.tagName == 'IMG') { @@ -125,7 +115,7 @@
has_mouse=true} on:mouseleave={() => has_mouse=false}> has_focus=true} on:blur={() => {has_focus=false;update_value()}} on:keydown={select_by_key}/> -