fix glitch for relation picker search (#8040)
Fix for #7957 --------- Co-authored-by: Félix Malfait <felix@twenty.com>
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
import { DropdownScopeInternalContext } from '@/ui/layout/dropdown/scopes/scope-internal-context/DropdownScopeInternalContext';
|
||||
import { dropdownHotkeyComponentState } from '@/ui/layout/dropdown/states/dropdownHotkeyComponentState';
|
||||
import { dropdownPlacementComponentState } from '@/ui/layout/dropdown/states/dropdownPlacementComponentState';
|
||||
import { dropdownWidthComponentState } from '@/ui/layout/dropdown/states/dropdownWidthComponentState';
|
||||
import { isDropdownOpenComponentState } from '@/ui/layout/dropdown/states/isDropdownOpenComponentState';
|
||||
import { useAvailableScopeIdOrThrow } from '@/ui/utilities/recoil-scope/scopes-internal/hooks/useAvailableScopeId';
|
||||
@ -19,6 +20,10 @@ export const useDropdownStates = ({
|
||||
|
||||
return {
|
||||
scopeId,
|
||||
dropdownPlacementState: extractComponentState(
|
||||
dropdownPlacementComponentState,
|
||||
scopeId,
|
||||
),
|
||||
dropdownHotkeyScopeState: extractComponentState(
|
||||
dropdownHotkeyComponentState,
|
||||
scopeId,
|
||||
|
||||
@ -12,6 +12,7 @@ export const useDropdown = (dropdownId?: string) => {
|
||||
dropdownHotkeyScopeState,
|
||||
dropdownWidthState,
|
||||
isDropdownOpenState,
|
||||
dropdownPlacementState,
|
||||
} = useDropdownStates({
|
||||
dropdownScopeId: getScopeIdOrUndefinedFromComponentId(dropdownId),
|
||||
});
|
||||
@ -25,6 +26,10 @@ export const useDropdown = (dropdownId?: string) => {
|
||||
|
||||
const [dropdownWidth, setDropdownWidth] = useRecoilState(dropdownWidthState);
|
||||
|
||||
const [dropdownPlacement, setDropdownPlacement] = useRecoilState(
|
||||
dropdownPlacementState,
|
||||
);
|
||||
|
||||
const [isDropdownOpen, setIsDropdownOpen] =
|
||||
useRecoilState(isDropdownOpenState);
|
||||
|
||||
@ -59,5 +64,7 @@ export const useDropdown = (dropdownId?: string) => {
|
||||
openDropdown,
|
||||
dropdownWidth,
|
||||
setDropdownWidth,
|
||||
dropdownPlacement,
|
||||
setDropdownPlacement,
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user