From a7cb0929bd064f73a1e3e49ba8dd6b6b7de387f4 Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Thu, 28 Sep 2023 10:50:49 -0700 Subject: fix: :bug: fix height bug after cmd+shift+R --- extension/react-app/src/components/ComboBox.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'extension') diff --git a/extension/react-app/src/components/ComboBox.tsx b/extension/react-app/src/components/ComboBox.tsx index 6c99a650..43b66476 100644 --- a/extension/react-app/src/components/ComboBox.tsx +++ b/extension/react-app/src/components/ComboBox.tsx @@ -286,9 +286,14 @@ const ComboBox = React.forwardRef((props: ComboBoxProps, ref) => { if (!inputRef.current) return; if (inputRef.current.scrollHeight > inputRef.current.clientHeight) { inputRef.current.style.height = "auto"; - inputRef.current.style.height = inputRef.current.scrollHeight + "px"; + inputRef.current.style.height = + Math.min(inputRef.current.scrollHeight, 300) + "px"; } - }, [inputRef.current, props.value]); + }, [ + inputRef.current?.scrollHeight, + inputRef.current?.clientHeight, + props.value, + ]); // Whether the current input follows an '@' and should be treated as context query const [currentlyInContextQuery, setCurrentlyInContextQuery] = useState(false); @@ -907,7 +912,6 @@ const ComboBox = React.forwardRef((props: ComboBoxProps, ref) => { setIsHovered(true)} onMouseLeave={(e) => { - console.log("left"); if ( e.relatedTarget === deleteButtonDivRef.current || deleteButtonDivRef.current?.contains(e.relatedTarget as Node) -- cgit v1.2.3-70-g09d2