From d68565b43c56976aae9288fed466e170095c2f27 Mon Sep 17 00:00:00 2001 From: devanshu052000 Date: Mon, 17 Mar 2025 17:15:36 +0530 Subject: [PATCH] Added support for arrow key navigation in Dropdown and Multiselect component. --- .../Components/DropdownV2/DropdownV2.jsx | 28 ++++++++++++++++--- .../MultiselectV2/CustomValueContainer.jsx | 9 +++++- .../MultiselectV2/MultiselectV2.jsx | 20 ++++++++++++- 3 files changed, 51 insertions(+), 6 deletions(-) diff --git a/frontend/src/Editor/Components/DropdownV2/DropdownV2.jsx b/frontend/src/Editor/Components/DropdownV2/DropdownV2.jsx index a01ed895e0..b2445435c0 100644 --- a/frontend/src/Editor/Components/DropdownV2/DropdownV2.jsx +++ b/frontend/src/Editor/Components/DropdownV2/DropdownV2.jsx @@ -88,6 +88,7 @@ export const DropdownV2 = ({ padding, } = styles; const isInitialRender = useRef(true); + const [isMenuOpen, setIsMenuOpen] = useState(false); const [currentValue, setCurrentValue] = useState(() => findDefaultItem(schema)); const isMandatory = validation?.mandatory ?? false; const options = properties?.options; @@ -353,15 +354,16 @@ export const DropdownV2 = ({ ...provided, padding: '0px', }), - option: (provided) => ({ + option: (provided, _state) => ({ ...provided, - backgroundColor: 'var(--surfaces-surface-01)', + backgroundColor: _state.isFocused ? 'var(--interactive-overlays-fill-hover)' : 'var(--surfaces-surface-01)', color: selectedTextColor !== '#1B1F24' ? selectedTextColor : isDropdownDisabled || isDropdownLoading ? 'var(--text-disabled)' : 'var(--text-primary)', + borderRadius: _state.isFocused && '8px', padding: '8px 6px 8px 38px', '&:hover': { backgroundColor: 'var(--interactive-overlays-fill-hover)', @@ -431,6 +433,7 @@ export const DropdownV2 = ({ />