mirror of
https://github.com/rohitg00/skillkit.git
synced 2026-11-19 02:13:58 +00:00
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
This commit is contained in:
@@ -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]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user