diff --git a/editor/src/messages/portfolio/document/document_message_handler.rs b/editor/src/messages/portfolio/document/document_message_handler.rs index 450e30a3..a2fd87c7 100644 --- a/editor/src/messages/portfolio/document/document_message_handler.rs +++ b/editor/src/messages/portfolio/document/document_message_handler.rs @@ -1180,7 +1180,7 @@ impl DocumentMessageHandler { .icon(DocumentMode::SelectMode.icon_name()) .on_update(|_| DialogMessage::RequestComingSoonDialog { issue: Some(330) }.into()), MenuListEntry::new(format!("{:?}", DocumentMode::GuideMode)) - .label(DocumentMode::SelectMode.to_string()) + .label(DocumentMode::GuideMode.to_string()) .icon(DocumentMode::GuideMode.icon_name()) .on_update(|_| DialogMessage::RequestComingSoonDialog { issue: Some(331) }.into()), ]]) diff --git a/frontend/src/components/floating-menus/Dialog.svelte b/frontend/src/components/floating-menus/Dialog.svelte index 1beecbbb..f8040a95 100644 --- a/frontend/src/components/floating-menus/Dialog.svelte +++ b/frontend/src/components/floating-menus/Dialog.svelte @@ -20,7 +20,7 @@ onMount(() => { // Focus the button which is marked as emphasized, or otherwise the first button, in the popup - const emphasizedOrFirstButton = (self?.div()?.querySelector("[data-emphasized]") || self?.div()?.querySelector("[data-text-button]") || undefined) as HTMLButtonElement | undefined; + const emphasizedOrFirstButton = (self?.div?.()?.querySelector("[data-emphasized]") || self?.div?.()?.querySelector("[data-text-button]") || undefined) as HTMLButtonElement | undefined; emphasizedOrFirstButton?.focus(); }); diff --git a/frontend/src/components/floating-menus/MenuList.svelte b/frontend/src/components/floating-menus/MenuList.svelte index f7cc172f..93727bc2 100644 --- a/frontend/src/components/floating-menus/MenuList.svelte +++ b/frontend/src/components/floating-menus/MenuList.svelte @@ -1,13 +1,15 @@ @@ -199,6 +394,9 @@ scrollableY={scrollableY && virtualScrollingEntryHeight === 0} bind:this={self} > + {#if search.length > 0} + (search = detail)} bind:this={searchTextInput}> + {/if} {/if} {#each entries as section, sectionIndex (sectionIndex)} - {#if sectionIndex > 0} + {#if includeSeparator(entries, section, sectionIndex, search)} {/if} - {#each virtualScrollingEntryHeight ? section.slice(virtualScrollingStartIndex, virtualScrollingEndIndex) : section as entry, entryIndex (entryIndex + startIndex)} + {#each currentEntries(section, virtualScrollingEntryHeight, virtualScrollingStartIndex, virtualScrollingEndIndex, search) as entry, entryIndex (entryIndex + startIndex)} - + { + // We do a manual dispatch here instead of just `on:naturalWidth` as a workaround for the @@ -68,7 +68,6 @@ {tooltip} on:click={() => !disabled && (open = true)} on:blur={unFocusDropdownBox} - on:keydown={(e) => menuList?.keydown(e, false)} tabindex={disabled ? -1 : 0} data-floating-menu-spawner > diff --git a/frontend/src/components/widgets/inputs/FontInput.svelte b/frontend/src/components/widgets/inputs/FontInput.svelte index 931bbbb0..e839f978 100644 --- a/frontend/src/components/widgets/inputs/FontInput.svelte +++ b/frontend/src/components/widgets/inputs/FontInput.svelte @@ -104,16 +104,7 @@ - menuList?.keydown(e, false)} - data-floating-menu-spawner - > + {activeEntry?.value || ""} diff --git a/frontend/src/components/widgets/inputs/TextInput.svelte b/frontend/src/components/widgets/inputs/TextInput.svelte index 2c9b0d1b..ecc696b1 100644 --- a/frontend/src/components/widgets/inputs/TextInput.svelte +++ b/frontend/src/components/widgets/inputs/TextInput.svelte @@ -17,6 +17,10 @@ export let centered = false; export let minWidth = 0; + let className = ""; + export { className as class }; + export let classes: Record = {}; + let self: FieldInput | undefined; let editing = false; @@ -50,11 +54,15 @@ export function focus() { self?.focus(); } + + export function element(): HTMLInputElement | HTMLTextAreaElement | undefined { + return self?.element(); + } 0 ? `${minWidth}px` : undefined }} {value} on:value @@ -71,6 +79,8 @@