From 15134cebbb414f2189d3e8a3df1d98e7df03a2f0 Mon Sep 17 00:00:00 2001 From: Rohit Ghumare <48523873+rohitg00@users.noreply.github.com> Date: Mon, 26 Jan 2026 20:51:22 +0000 Subject: [PATCH] fix: prevent auto-scroll to Skill Finder on page load - Remove auto-focus on initial page load - Only focus input after user interaction (SUCCESS state) - Use preventScroll option to avoid scroll jumps --- docs/skillkit/components/SkillGenerator.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/skillkit/components/SkillGenerator.tsx b/docs/skillkit/components/SkillGenerator.tsx index 62d7a18a..9225be81 100644 --- a/docs/skillkit/components/SkillGenerator.tsx +++ b/docs/skillkit/components/SkillGenerator.tsx @@ -187,9 +187,10 @@ export function SkillGenerator(): React.ReactElement { } } + // Focus input only after user interaction, not on initial page load useEffect(() => { - if (status === LoadingState.IDLE && inputRef.current) { - inputRef.current.focus(); + if (status === LoadingState.SUCCESS && inputRef.current) { + inputRef.current.focus({ preventScroll: true }); } }, [status]);