diff --git a/lib/components/ViewPublicationPage/StartPageViewPublication.tsx b/lib/components/ViewPublicationPage/StartPageViewPublication.tsx index 7dcd491..2cec77a 100644 --- a/lib/components/ViewPublicationPage/StartPageViewPublication.tsx +++ b/lib/components/ViewPublicationPage/StartPageViewPublication.tsx @@ -302,7 +302,7 @@ function QuizPreviewLayoutByType({ justifyContent: "space-between", alignItems: "flex-start", p: "25px", - height: "80%", + height: "100%", overflowY: "auto", overflowX: "hidden" }} diff --git a/lib/components/ViewPublicationPage/questions/Text.tsx b/lib/components/ViewPublicationPage/questions/Text.tsx index 0bd72f7..41747fa 100644 --- a/lib/components/ViewPublicationPage/questions/Text.tsx +++ b/lib/components/ViewPublicationPage/questions/Text.tsx @@ -8,7 +8,7 @@ import { sendAnswer } from "@api/quizRelase"; import { useQuizData } from "@contexts/QuizDataContext"; import { useRootContainerSize } from "@contexts/RootContainerWidthContext"; import { enqueueSnackbar } from "notistack"; -import { useState } from "react"; +import {useEffect, useState} from "react"; import { useDebouncedCallback } from "use-debounce"; import type { QuizQuestionText } from "../../../model/questionTypes/text"; @@ -68,6 +68,12 @@ export const Text = ({ currentQuestion, stepNumber }: TextProps) => { setIsSending(false); }, 400); + useEffect( + () => () => { + inputHC.flush(); + }, + [inputHC] + ); switch (spec) { case true: return ; @@ -78,7 +84,15 @@ export const Text = ({ currentQuestion, stepNumber }: TextProps) => { } }; -const TextNormal = ({currentQuestion, spec, answer, inputHC}) => { +interface Props { + currentQuestion: QuizQuestionText; + spec: boolean | undefined; + answer: any, + stepNumber: number | null; + inputHC: (string) => void; +} + +const TextNormal = ({currentQuestion, spec, answer, inputHC, stepNumber}: Props) => { const isMobile = useRootContainerSize() < 650; const theme = useTheme(); return( @@ -94,6 +108,7 @@ const TextNormal = ({currentQuestion, spec, answer, inputHC}) => { }} > { ) }; - const TextSpecial = ({currentQuestion, spec, answer, inputHC, stepNumber}) => { + const TextSpecial = ({currentQuestion, spec, answer, inputHC, stepNumber}: Props) => { const theme = useTheme(); const isMobile = useRootContainerSize() < 650; const isHorizontal = Orientation[stepNumber -1].horizontal - console.log(stepNumber) return( { )}