From c8466bc1cf3021a60ef629a0bd9b5feb476a10ff Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Wed, 10 Mar 2021 10:35:16 +0000 Subject: [PATCH] Ignore click actions when a screen search string exists --- .../ComponentNavigationTree/PathTree.svelte | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/builder/src/components/design/NavigationPanel/ComponentNavigationTree/PathTree.svelte b/packages/builder/src/components/design/NavigationPanel/ComponentNavigationTree/PathTree.svelte index 09e8948407..ad1b54d700 100644 --- a/packages/builder/src/components/design/NavigationPanel/ComponentNavigationTree/PathTree.svelte +++ b/packages/builder/src/components/design/NavigationPanel/ComponentNavigationTree/PathTree.svelte @@ -9,6 +9,7 @@ import ComponentTree from "./ComponentTree.svelte" import NavItem from "components/common/NavItem.svelte" import ScreenDropdownMenu from "./ScreenDropdownMenu.svelte" + import { get } from "svelte/store" const ROUTE_NAME_MAP = { "/": { @@ -56,13 +57,20 @@ screen => !searchString || screen.route.includes(searchString) ) } + + const toggleManuallyOpened = () => { + if (get(screenSearchString)) { + return + } + routeManuallyOpened = !routeManuallyOpened + } {#if !noSearchMatch} (routeManuallyOpened = !routeManuallyOpened)} + on:click={toggleManuallyOpened} opened={routeOpened} {border} withArrow={route.subpaths} />