From 955aea2733f6d7e213d2213e9edc68078bc7aa9c Mon Sep 17 00:00:00 2001 From: ahmadshaheer Date: Wed, 4 Dec 2024 18:35:44 +0430 Subject: [PATCH] fix: handle edge case for logs column options menu navigation --- .../components/LogsFormatOptionsMenu/LogsFormatOptionsMenu.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/frontend/src/components/LogsFormatOptionsMenu/LogsFormatOptionsMenu.tsx b/frontend/src/components/LogsFormatOptionsMenu/LogsFormatOptionsMenu.tsx index 740ceaf5b7f..cc533b5a968 100644 --- a/frontend/src/components/LogsFormatOptionsMenu/LogsFormatOptionsMenu.tsx +++ b/frontend/src/components/LogsFormatOptionsMenu/LogsFormatOptionsMenu.tsx @@ -152,6 +152,8 @@ export default function LogsFormatOptionsMenu({ const itemLength = optionsData.length; + if (!optionsData?.length || currentIndex < 0) return; + switch (e.key) { case 'ArrowUp': { const newValue = optionsData[Math.max(0, currentIndex - 1)]?.value;