{isAnswerVisible && (
)}
@@ -47,15 +66,25 @@ export function RoadmapTitleQuestion(props: RoadmapTitleQuestionProps) {
{isAnswerVisible && (
setIsAnswerVisible(false)}
+ className={cn(
+ 'sticky top-0 flex cursor-pointer select-none items-center rounded-t-md border-b bg-white px-[7px] py-[9px] text-base font-medium',
+ )}
+ onClick={() => {
+ setIsAnswerVisible(false);
+ if (
+ scrollY > (h2Ref?.current?.getBoundingClientRect().top || 0)
+ ) {
+ ref.current?.scrollIntoView();
+ }
+ }}
+ ref={h2Ref}
>
@@ -67,7 +96,7 @@ export function RoadmapTitleQuestion(props: RoadmapTitleQuestionProps) {
)}
diff --git a/src/pages/[roadmapId]/index.astro b/src/pages/[roadmapId]/index.astro
index 78d4c926a..524508bcb 100644
--- a/src/pages/[roadmapId]/index.astro
+++ b/src/pages/[roadmapId]/index.astro
@@ -123,6 +123,7 @@ const projects = await getProjectsByRoadmapId(roadmapId);
question?.title && (