Fixed date input fields (#9442)

- Fixed date input fields : proper hotkey management, like other fields
- Removed DropdownUnmountEffect which was causing many bugs.
This commit is contained in:
Lucas Bordeau
2025-01-08 10:43:49 +01:00
committed by GitHub
parent 3198748401
commit 00a9646d68
7 changed files with 44 additions and 63 deletions

View File

@ -15,7 +15,6 @@ import { Keys } from 'react-hotkeys-hook';
import { useDropdown } from '../hooks/useDropdown';
import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent';
import { DropdownUnmountEffect } from '@/ui/layout/dropdown/components/DropdownUnmountEffect';
import { DropdownComponentInstanceContext } from '@/ui/layout/dropdown/contexts/DropdownComponeInstanceContext';
import { dropdownHotkeyComponentState } from '@/ui/layout/dropdown/states/dropdownHotkeyComponentState';
import { dropdownMaxHeightComponentStateV2 } from '@/ui/layout/dropdown/states/dropdownMaxHeightComponentStateV2';
@ -165,7 +164,6 @@ export const Dropdown = ({
/>
</>
</DropdownScope>
<DropdownUnmountEffect dropdownId={dropdownId} />
</DropdownComponentInstanceContext.Provider>
);
};

View File

@ -1,18 +0,0 @@
import { useDropdownV2 } from '@/ui/layout/dropdown/hooks/useDropdownV2';
import { useEffect } from 'react';
export const DropdownUnmountEffect = ({
dropdownId,
}: {
dropdownId: string;
}) => {
const { closeDropdown } = useDropdownV2();
useEffect(() => {
return () => {
closeDropdown(dropdownId);
};
}, [closeDropdown, dropdownId]);
return null;
};