From 7b9748601b731ca089b5d0fe31cd048fbcfb52a0 Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Mon, 23 Oct 2023 11:56:05 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix=20hidden=20items=20in=20drop?= =?UTF-8?q?down=20by=20setting=20height?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gui/src/components/ComboBox.tsx | 117 ++++++++++++++++++-------------- 1 file changed, 65 insertions(+), 52 deletions(-) diff --git a/gui/src/components/ComboBox.tsx b/gui/src/components/ComboBox.tsx index 87713a5b3..e6ee19f82 100644 --- a/gui/src/components/ComboBox.tsx +++ b/gui/src/components/ComboBox.tsx @@ -655,6 +655,7 @@ const ComboBox = React.forwardRef((props: ComboBoxProps, ref) => { }, [inputRef.current, props.isMainInput]); const deleteButtonDivRef = React.useRef(null); + const stickyDropdownHeaderDiv = React.useRef(null); const selectContextItem = useCallback( (id: string, query: string) => { @@ -1288,6 +1289,7 @@ const ComboBox = React.forwardRef((props: ComboBoxProps, ref) => { > {nestedContextProvider && (
{ {nestedContextProvider.description}
)} - {downshiftProps.isOpen && - items.map((item, index) => ( -
  • { - selectContextItemFromDropdown(e); - e.stopPropagation(); - e.preventDefault(); - inputRef.current?.focus(); - }} - > - -
    - {nestedContextProvider && ( - - )} - {item.name} - {" "} -
    - - {item.description} +
    + {downshiftProps.isOpen && + items.map((item, index) => ( +
  • { + selectContextItemFromDropdown(e); + e.stopPropagation(); + e.preventDefault(); + inputRef.current?.focus(); + }} + > + +
    + {nestedContextProvider && ( + + )} + {item.name} + {" "} +
    + + {item.description} +
    - - {contextProviders - ?.filter( - (provider) => !provider.dynamic || provider.requires_query - ) - .find((provider) => provider.title === item.id) && ( - - )} -
  • - ))} + {contextProviders + ?.filter( + (provider) => !provider.dynamic || provider.requires_query + ) + .find((provider) => provider.title === item.id) && ( + + )} + + ))} + {downshiftProps.isOpen && items.length === 0 && (