refactor: make all event listeners optional

This commit is contained in:
Devessier 2024-11-21 12:00:38 +01:00
parent a304a8d51a
commit 7c3791a098
2 changed files with 5 additions and 5 deletions

View File

@ -18,8 +18,8 @@ export const useRegisterInputEvents = <T>({
inputRef: React.RefObject<any>;
copyRef?: React.RefObject<any>;
inputValue: T;
onEscape: (inputValue: T) => void;
onEnter: (inputValue: T) => void;
onEscape?: (inputValue: T) => void;
onEnter?: (inputValue: T) => void;
onTab?: (inputValue: T) => void;
onShiftTab?: (inputValue: T) => void;
onClickOutside?: (event: MouseEvent | TouchEvent, inputValue: T) => void;

View File

@ -15,11 +15,11 @@ type TextInputProps = {
placeholder?: string;
autoFocus?: boolean;
value: string;
onEnter: (newText: string) => void;
onEscape: (newText: string) => void;
onEnter?: (newText: string) => void;
onEscape?: (newText: string) => void;
onTab?: (newText: string) => void;
onShiftTab?: (newText: string) => void;
onClickOutside: (event: MouseEvent | TouchEvent, inputValue: string) => void;
onClickOutside?: (event: MouseEvent | TouchEvent, inputValue: string) => void;
hotkeyScope: string;
onChange?: (newText: string) => void;
copyButton?: boolean;