Replace hotkey scopes by focus stack (Part 4 - Inputs) (#12933)
# Replace hotkey scopes by focus stack (Part 4 - Inputs) This PR is the 4th part of a refactoring aiming to deprecate the hotkey scopes api in favor of the new focus stack api which is more robust. Part 1: https://github.com/twentyhq/twenty/pull/12673 Part 2: https://github.com/twentyhq/twenty/pull/12798 Part 3: https://github.com/twentyhq/twenty/pull/12910 In this part, I refactored all inputs in the app so that each input has a unique id which can be used to track the focused element.
This commit is contained in:
@@ -4,11 +4,12 @@ import TextareaAutosize from 'react-textarea-autosize';
|
||||
|
||||
import { LightCopyIconButton } from '@/object-record/record-field/components/LightCopyIconButton';
|
||||
import { useRegisterInputEvents } from '@/object-record/record-field/meta-types/input/hooks/useRegisterInputEvents';
|
||||
import { turnIntoEmptyStringIfWhitespacesOnly } from '~/utils/string/turnIntoEmptyStringIfWhitespacesOnly';
|
||||
import { isDefined } from 'twenty-shared/utils';
|
||||
import { TEXT_INPUT_STYLE } from 'twenty-ui/theme';
|
||||
import { turnIntoEmptyStringIfWhitespacesOnly } from '~/utils/string/turnIntoEmptyStringIfWhitespacesOnly';
|
||||
|
||||
export type TextAreaInputProps = {
|
||||
instanceId: string;
|
||||
disabled?: boolean;
|
||||
className?: string;
|
||||
placeholder?: string;
|
||||
@@ -46,6 +47,7 @@ const StyledLightIconButtonContainer = styled.div`
|
||||
`;
|
||||
|
||||
export const TextAreaInput = ({
|
||||
instanceId,
|
||||
disabled,
|
||||
className,
|
||||
placeholder,
|
||||
@@ -83,6 +85,7 @@ export const TextAreaInput = ({
|
||||
}, []);
|
||||
|
||||
useRegisterInputEvents({
|
||||
focusId: instanceId,
|
||||
inputRef: wrapperRef,
|
||||
copyRef: copyRef,
|
||||
inputValue: internalText,
|
||||
|
||||
Reference in New Issue
Block a user