Skip to content

Commit cff58e6

Browse files
committed
fix(app): prevent question dock from auto-scrolling to focused option
When the question dock opens, focus(0) targets the first option button which sits below the markdown content. The browser auto-scrolls the overflow container to make the focused element visible, hiding the plan text. Use preventScroll: true so focus is set for keyboard navigation without scrolling away from the top.
1 parent 06f198a commit cff58e6

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

packages/app/src/pages/session/composer/session-question-dock.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ export const SessionQuestionDock: Component<{ request: QuestionRequest; onSubmit
160160
focusFrame = requestAnimationFrame(() => {
161161
focusFrame = undefined
162162
const el = next === options().length ? customRef : optsRef[next]
163-
el?.focus()
163+
el?.focus({ preventScroll: true })
164164
})
165165
}
166166

0 commit comments

Comments
 (0)