diff --git a/gui/src/components/mainInput/InputToolbar.tsx b/gui/src/components/mainInput/InputToolbar.tsx index 49c40e65d..2f7c6a3b1 100644 --- a/gui/src/components/mainInput/InputToolbar.tsx +++ b/gui/src/components/mainInput/InputToolbar.tsx @@ -106,7 +106,6 @@ function InputToolbar(props: InputToolbarProps) {
diff --git a/gui/src/components/mainInput/InputToolbar/ToggleToolsButton.tsx b/gui/src/components/mainInput/InputToolbar/ToggleToolsButton.tsx index cffc967f0..20dae9160 100644 --- a/gui/src/components/mainInput/InputToolbar/ToggleToolsButton.tsx +++ b/gui/src/components/mainInput/InputToolbar/ToggleToolsButton.tsx @@ -153,7 +153,7 @@ export default function ToolDropdown(props: ToolDropdownProps) { />
-
+
{availableTools.map((tool: any) => ( { if (queryInputRef.current) { queryInputRef.current.focus(); } - }, [querySubmenuItem]); + }, [querySubmenuItem, queryInputRef]); const selectItem = (index: number) => { const item = allItems[index]; @@ -378,6 +378,9 @@ const MentionList = forwardRef((props: MentionListProps, ref) => { {querySubmenuItem ? ( { + e.stopPropagation(); + }} rows={1} ref={queryInputRef} placeholder={querySubmenuItem.description} @@ -436,7 +439,10 @@ const MentionList = forwardRef((props: MentionListProps, ref) => { ref={(el) => (itemRefs.current[index] = el)} className={`item cursor-pointer ${isSelected ? "is-selected" : ""}`} key={index} - onClick={() => selectItem(index)} + onClick={(e) => { + e.stopPropagation(); + selectItem(index); + }} onMouseEnter={() => setSelectedIndex(index)} data-testid="context-provider-dropdown-item" > diff --git a/gui/src/components/mainInput/TipTapEditor.tsx b/gui/src/components/mainInput/TipTapEditor.tsx index 51fb3e91f..35e993a54 100644 --- a/gui/src/components/mainInput/TipTapEditor.tsx +++ b/gui/src/components/mainInput/TipTapEditor.tsx @@ -591,11 +591,12 @@ function TipTapEditor(props: TipTapEditorProps) { useEffect(() => { if (editor) { const handleFocus = () => { - debouncedShouldHideToolbar(false); + setShouldHideToolbar(false); }; const handleBlur = () => { - debouncedShouldHideToolbar(true); + // TODO - make toolbar auto-hiding work without breaking tool dropdown focus + // debouncedShouldHideToolbar(true); }; editor.on("focus", handleFocus);