From 1dc83ca71a247652dd1a0cc8d3eec1886773dd87 Mon Sep 17 00:00:00 2001 From: Sahil Sahney Date: Fri, 10 Jul 2026 00:04:09 +0530 Subject: [PATCH] Fix node catalog preserving type search on autofocus --- frontend/src/components/floating-menus/NodeCatalog.svelte | 2 +- frontend/src/components/widgets/inputs/TextInput.svelte | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/frontend/src/components/floating-menus/NodeCatalog.svelte b/frontend/src/components/floating-menus/NodeCatalog.svelte index 08d287d4b7..82b66aa592 100644 --- a/frontend/src/components/floating-menus/NodeCatalog.svelte +++ b/frontend/src/components/floating-menus/NodeCatalog.svelte @@ -113,7 +113,7 @@ - (searchTerm = detail)} bind:this={nodeSearchInput} /> + (searchTerm = detail)} selectAllOnFocus={false} bind:this={nodeSearchInput} />
{#each nodeCategories as nodeCategory}
diff --git a/frontend/src/components/widgets/inputs/TextInput.svelte b/frontend/src/components/widgets/inputs/TextInput.svelte index 613e21f2e4..a1cca00981 100644 --- a/frontend/src/components/widgets/inputs/TextInput.svelte +++ b/frontend/src/components/widgets/inputs/TextInput.svelte @@ -16,10 +16,12 @@ // Sizing export let minWidth = 0; export let maxWidth = 0; - // Tooltips + // Tooltips export let tooltipLabel: string | undefined = undefined; export let tooltipDescription: string | undefined = undefined; export let tooltipShortcut: ActionShortcut | undefined = undefined; + // Behavior + export let selectAllOnFocus = true; let className = ""; export { className as class }; @@ -28,10 +30,10 @@ let self: FieldInput | undefined; let editing = false; - function onTextFocused() { + function onTextFocused() { editing = true; - self?.selectAllText(value); + if (selectAllOnFocus) self?.selectAllText(value); } // Called only when `value` is changed from the element via user input and committed, either with the