Remove cell hotkey scope (#11435)
Remove FieldContext hotkey scope as:
- each Field should set its own hotkey scope (ex:
emails-field-input-{recordId} or emails-field-input for now)
- while opening a fieldInput, we should synchronously set the
corresponding hotkey scope
To cut this refactoring in half, I'm allowing all input to use
TableHotkeyScope.CellEditMode
This commit is contained in:
@ -3,7 +3,6 @@ import { useRef, useState } from 'react';
|
||||
import { useRegisterInputEvents } from '@/object-record/record-field/meta-types/input/hooks/useRegisterInputEvents';
|
||||
import {
|
||||
DateTimePicker,
|
||||
MONTH_AND_YEAR_DROPDOWN_ID,
|
||||
MONTH_AND_YEAR_DROPDOWN_MONTH_SELECT_ID,
|
||||
MONTH_AND_YEAR_DROPDOWN_YEAR_SELECT_ID,
|
||||
} from '@/ui/input/components/internal/date/components/InternalDatePicker';
|
||||
@ -59,7 +58,6 @@ export const DateInput = ({
|
||||
onSubmit?.(newDate);
|
||||
};
|
||||
|
||||
const { closeDropdown } = useDropdown(MONTH_AND_YEAR_DROPDOWN_ID);
|
||||
const { closeDropdown: closeDropdownMonthSelect } = useDropdown(
|
||||
MONTH_AND_YEAR_DROPDOWN_MONTH_SELECT_ID,
|
||||
);
|
||||
@ -70,7 +68,6 @@ export const DateInput = ({
|
||||
const handleEnter = () => {
|
||||
closeDropdownYearSelect();
|
||||
closeDropdownMonthSelect();
|
||||
closeDropdown();
|
||||
|
||||
onEnter(internalValue);
|
||||
};
|
||||
@ -78,7 +75,6 @@ export const DateInput = ({
|
||||
const handleEscape = () => {
|
||||
closeDropdownYearSelect();
|
||||
closeDropdownMonthSelect();
|
||||
closeDropdown();
|
||||
|
||||
onEscape(internalValue);
|
||||
};
|
||||
@ -88,8 +84,8 @@ export const DateInput = ({
|
||||
|
||||
closeDropdownYearSelect();
|
||||
closeDropdownMonthSelect();
|
||||
closeDropdown();
|
||||
|
||||
onEscape(internalValue);
|
||||
onClickOutside(event, internalValue);
|
||||
};
|
||||
|
||||
|
||||
@ -23,7 +23,6 @@ import {
|
||||
StyledHoverableMenuItemBase,
|
||||
} from 'twenty-ui/navigation';
|
||||
|
||||
export const MONTH_AND_YEAR_DROPDOWN_ID = 'date-picker-month-and-year-dropdown';
|
||||
export const MONTH_AND_YEAR_DROPDOWN_MONTH_SELECT_ID =
|
||||
'date-picker-month-and-year-dropdown-month-select';
|
||||
export const MONTH_AND_YEAR_DROPDOWN_YEAR_SELECT_ID =
|
||||
@ -325,7 +324,6 @@ export const DateTimePicker = ({
|
||||
|
||||
const { timeZone } = useContext(UserContext);
|
||||
|
||||
const { closeDropdown } = useDropdown(MONTH_AND_YEAR_DROPDOWN_ID);
|
||||
const { closeDropdown: closeDropdownMonthSelect } = useDropdown(
|
||||
MONTH_AND_YEAR_DROPDOWN_MONTH_SELECT_ID,
|
||||
);
|
||||
@ -341,7 +339,6 @@ export const DateTimePicker = ({
|
||||
const closeDropdowns = () => {
|
||||
closeDropdownYearSelect();
|
||||
closeDropdownMonthSelect();
|
||||
closeDropdown();
|
||||
};
|
||||
|
||||
const handleClose = (newDate: Date) => {
|
||||
|
||||
Reference in New Issue
Block a user