From 5b5b4c888ac08163edd13c698037120df8bd8768 Mon Sep 17 00:00:00 2001
From: ivarlovlie <git@ivarlovlie.no>
Date: Fri, 3 Jun 2022 00:57:17 +0200
Subject: fix: !WIP flickering dropdown on multi dropdowns with new focus
 strategy

---
 apps/web-shared/src/components/dropdown.svelte | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

(limited to 'apps/web-shared/src/components/dropdown.svelte')

diff --git a/apps/web-shared/src/components/dropdown.svelte b/apps/web-shared/src/components/dropdown.svelte
index 2cddce9..d53bb6e 100644
--- a/apps/web-shared/src/components/dropdown.svelte
+++ b/apps/web-shared/src/components/dropdown.svelte
@@ -225,7 +225,6 @@
                     } else {
                         document.querySelector("#" + INTERNAL_ID + " ul li:first-of-type").classList.add("focus");
                         document.querySelector("#" + INTERNAL_ID + " ul li:first-of-type").scrollIntoView();
-
                     }
                 } else if (arrowUpPressed) {
                     if (focusedEntry.previousElementSibling) {
@@ -280,6 +279,11 @@
 >
     <!-- input -->
     <div class="select-auto__input-wrapper form-control"
+         style="cursor: text"
+         on:click={() => {
+			 if (!element_has_focus(searchInputNode)) searchInputNode.focus();
+			 showDropdown = true;
+         }}
          class:multiple={multiple === true}
          class:has-selection={hasSelection}>
         {#if multiple === true && hasSelection}
-- 
cgit v1.3

