fix: allow spaces in title input (#504)

This commit is contained in:
Carlos Valente
2023-09-01 23:26:59 +02:00
committed by GitHub
parent 23dcca5527
commit 8d427a6bbe
6 changed files with 11 additions and 10 deletions
@@ -1,6 +1,5 @@
import { useCallback } from 'react';
import { Input, InputProps } from '@chakra-ui/react';
import { sanitiseCue } from 'ontime-utils';
import useReactiveTextInput from '../../../common/components/input/text-input/useReactiveTextInput';
import { EditorUpdateFields } from '../EventEditor';
@@ -17,10 +16,7 @@ interface CountedTextInputProps extends InputProps {
export default function CountedTextInput(props: CountedTextInputProps) {
const { field, label, initialValue, submitHandler, maxLength } = props;
const submitCallback = useCallback(
(newValue: string) => submitHandler(field, sanitiseCue(newValue)),
[field, submitHandler],
);
const submitCallback = useCallback((newValue: string) => submitHandler(field, newValue), [field, submitHandler]);
const { value, onChange, onBlur, onKeyDown } = useReactiveTextInput(initialValue, submitCallback, {
submitOnEnter: true,