From a5e561c81ddec5fac2ded287b2e534b0c5cb9468 Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Fri, 3 Mar 2023 16:45:25 -0700 Subject: [PATCH] Restrict menu height to ensure it does not overflow (#5601) --- web/src/components/MultiSelect.jsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/web/src/components/MultiSelect.jsx b/web/src/components/MultiSelect.jsx index 99412e938..226316966 100644 --- a/web/src/components/MultiSelect.jsx +++ b/web/src/components/MultiSelect.jsx @@ -13,9 +13,11 @@ export default function MultiSelect({ className, title, options, selection, onTo const [state, setState] = useState({ showMenu: false, }); - + const isOptionSelected = (item) => { return selection == "all" || selection.split(',').indexOf(item) > -1; } - + + const menuHeight = Math.round(window.innerHeight * 0.55); + return (
{state.showMenu ? ( - setState({ showMenu: false })}> + setState({ showMenu: false })}>
{title}