Skip to content

fix(command-center): prevent scroll on grid cell focus#2956

Open
K3N4Y wants to merge 1 commit into
PostHog:mainfrom
K3N4Y:fix/command-center-prevent-scroll-on-focus
Open

fix(command-center): prevent scroll on grid cell focus#2956
K3N4Y wants to merge 1 commit into
PostHog:mainfrom
K3N4Y:fix/command-center-prevent-scroll-on-focus

Conversation

@K3N4Y

@K3N4Y K3N4Y commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Problem

When clicking a command center grid cell, the browser scrolls the page to bring the newly-focused element into view. This is the default behavior of .focus() — it scrolls the focused element into the visible viewport, which jumps the user away from where they were.

Changes

Added { preventScroll: true } to the .focus() call in CommandCenterGrid.tsx:84-85. This tells the browser to focus the element without scrolling, matching the intent of the click handler (which delegates focus to an interactive element inside the cell without moving the viewport).

How did you test this?

  • tsc --noEmit clean
  • biome check clean
  • vitest run — 116 files, 1018 tests (UI), 179 files, 1755 tests (core), all passing
  • Host boundary check clean

Automatic notifications

  • Publish to changelog?
  • Alert Sales and Marketing teams?

Calling .focus() without preventScroll caused the page to scroll
to the top when clicking a command center grid cell.
@greptile-apps

greptile-apps Bot commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Reviews (1): Last reviewed commit: "fix(command-center): prevent scroll on g..." | Re-trigger Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant