From e8c289be565660b39ed30dc1815ec97dd354a478 Mon Sep 17 00:00:00 2001 From: Matthew Mikolay Date: Fri, 7 Feb 2025 14:15:51 -0500 Subject: [PATCH] Apply default maxHeight to Options only when a custom maxHeight is not specified --- packages/combobox/src/Combobox/Combobox.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/combobox/src/Combobox/Combobox.tsx b/packages/combobox/src/Combobox/Combobox.tsx index a8097d72..ddcc41b5 100644 --- a/packages/combobox/src/Combobox/Combobox.tsx +++ b/packages/combobox/src/Combobox/Combobox.tsx @@ -707,6 +707,8 @@ type OptionsProps = TgphComponentProps>; const Options = ({ ...props }: OptionsProps) => { const context = React.useContext(ComboboxContext); + const { maxHeight } = props; + return ( ({ ...props }: OptionsProps) => { gap="1" style={{ overflowY: "auto", - // Available Height - Padding from edge of screen - maxHeight: - "calc(var(--tgph-combobox-content-available-height) - var(--tgph-spacing-12))", + // maxHeight defaults to available height - padding from edge of screen + maxHeight: !maxHeight + ? "calc(var(--tgph-combobox-content-available-height) - var(--tgph-spacing-12))" + : undefined, }} // Accessibility attributes role="listbox"