From 95de56d81bb2fa202f0b6fc08a37ce27d658fab6 Mon Sep 17 00:00:00 2001 From: Daniel Date: Thu, 14 May 2026 17:30:08 +0200 Subject: [PATCH] Improve quiz note and navigation layout --- frontend/src/components/MyNote.jsx | 14 ++++++++++++++ frontend/src/pages/QuizPage.jsx | 4 ++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/MyNote.jsx b/frontend/src/components/MyNote.jsx index b827ed1..db86471 100644 --- a/frontend/src/components/MyNote.jsx +++ b/frontend/src/components/MyNote.jsx @@ -30,6 +30,7 @@ export default function MyNote({ variant = 'tab' }) { const loadedRef = useRef(false) const dragRef = useRef(null) const draggedRef = useRef(false) + const textareaRef = useRef(null) const loadNote = async () => { if (loadedRef.current) return @@ -107,6 +108,18 @@ export default function MyNote({ variant = 'tab' }) { return () => clearTimeout(saveRef.current) }, [content]) + useEffect(() => { + if (!open || loading) return + requestAnimationFrame(() => { + const textarea = textareaRef.current + if (!textarea) return + const end = textarea.value.length + textarea.focus() + textarea.setSelectionRange(end, end) + textarea.scrollTop = textarea.scrollHeight + }) + }, [open, loading]) + const openNote = () => { setOpen(true) loadNote() @@ -184,6 +197,7 @@ export default function MyNote({ variant = 'tab' }) { {error &&
{error}
}