fix textfield ts(2590)

This commit is contained in:
nflnkr 2024-02-26 12:45:56 +03:00
parent 69e76397f5
commit 3f82b7d97a

@ -19,10 +19,11 @@ import {
IconButton,
InputAdornment,
Paper,
TextField,
TextField as MuiTextField,
Typography,
useMediaQuery,
useTheme,
TextFieldProps,
} from "@mui/material";
import {
copyQuestion,
@ -33,7 +34,7 @@ import {
updateUntypedQuestion,
} from "@root/questions/actions";
import CustomTextField from "@ui_kit/CustomTextField";
import { useRef, useState } from "react";
import { FC, useRef, useState } from "react";
import type { DraggableProvidedDragHandleProps } from "react-beautiful-dnd";
import { useDebouncedCallback } from "use-debounce";
import type {
@ -55,6 +56,8 @@ import {
SignalCellularNullOutlined,
} from "@mui/icons-material";
const TextField = MuiTextField as unknown as FC<TextFieldProps>;
interface Props {
question: AnyTypedQuizQuestion | UntypedQuizQuestion;
questionIndex: number;
@ -136,8 +139,7 @@ export default function QuestionsPageCard({
placeholder={`Заголовок ${questionIndex + 1} вопроса`}
defaultValue={question.title}
onChange={({ target }) => {
if ((target.value, toString().length <= 225))
setTitle(target.value);
if (target.value.length <= 225) setTitle(target.value);
}}
onFocus={handleInputFocus}
onBlur={handleInputBlur}