Merge branch 'fixes' into 'main'
инпут ползунка не принимает буквы See merge request frontend/squiz!112
This commit is contained in:
commit
2300194038
@ -221,7 +221,7 @@ export const Footer = ({
|
||||
const questionIndex = questions.findIndex(({ id }) => id === question.id);
|
||||
|
||||
const previousQuestion = questions[questionIndex - 1];
|
||||
|
||||
followPreviousStep
|
||||
if (previousQuestion) {
|
||||
setCurrentQuestion(previousQuestion);
|
||||
}
|
||||
|
@ -1,19 +1,14 @@
|
||||
import { useEffect, useState } from "react";
|
||||
import { Box, Button, ThemeProvider, useTheme } from "@mui/material";
|
||||
import { Box, ThemeProvider, useTheme } from "@mui/material";
|
||||
|
||||
import { StartPageViewPublication } from "./StartPageViewPublication";
|
||||
import { Question } from "./Question";
|
||||
import { useQuestions } from "@root/questions/hooks";
|
||||
import { useCurrentQuiz } from "@root/quizes/hooks";
|
||||
import useSWR from "swr";
|
||||
import { quizApi } from "@api/quiz";
|
||||
import { setQuizes, updateQuiz } from "@root/quizes/actions";
|
||||
import { isAxiosError } from "axios";
|
||||
import { devlog } from "@frontend/kitui";
|
||||
import { useQuizStore } from "@root/quizes/store";
|
||||
|
||||
import type { AnyTypedQuizQuestion } from "../../model/questionTypes/shared";
|
||||
import { enqueueSnackbar } from "notistack";
|
||||
import { useQuestionsStore } from "@root/questions/store";
|
||||
import { setQuestions } from "@root/questions/actions";
|
||||
import { questionApi } from "@api/question";
|
||||
|
@ -122,7 +122,7 @@ export const Number = ({ currentQuestion }: NumberProps) => {
|
||||
onChange={({ target }) => {
|
||||
updateAnswer(
|
||||
currentQuestion.content.id,
|
||||
window.Number(target.value) > max
|
||||
window.Number(target.value.replace (/\D/, '')) > max
|
||||
? String(max)
|
||||
: window.Number(target.value) < min
|
||||
? String(min)
|
||||
@ -155,7 +155,7 @@ export const Number = ({ currentQuestion }: NumberProps) => {
|
||||
placeholder="0"
|
||||
value={minRange}
|
||||
onChange={({ target }) => {
|
||||
setMinRange(target.value);
|
||||
setMinRange(target.value.replace (/\D/, ''));
|
||||
|
||||
if (window.Number(target.value) >= window.Number(maxRange)) {
|
||||
updateMinRangeDebounced(`${maxRange}—${maxRange}`, true);
|
||||
@ -181,7 +181,7 @@ export const Number = ({ currentQuestion }: NumberProps) => {
|
||||
placeholder="0"
|
||||
value={maxRange}
|
||||
onChange={({ target }) => {
|
||||
setMaxRange(target.value);
|
||||
setMaxRange(target.value.replace (/\D/, ''));
|
||||
|
||||
if (window.Number(target.value) <= window.Number(minRange)) {
|
||||
updateMaxRangeDebounced(`${minRange}—${minRange}`, true);
|
||||
|
Loading…
Reference in New Issue
Block a user