Skip to content

[Bug] Arrow key navigation wraps around at sheet boundaries instead of stopping #6687

@getmateri

Description

@getmateri

Description

When pressing arrow keys at the edge of the sheet (e.g., LEFT at column 0, UP at row 0), the cell selector wraps around to the opposite end of the sheet. Both Excel and Google Sheets treat boundaries as hard walls — the selection stays put.

Steps to Reproduce

  1. Open any Univer spreadsheet
  2. Click on cell A1 (row 0, column 0)
  3. Press the LEFT arrow key

Expected: Selection stays at A1
Actual: Selection wraps to the last column of the last row

Root Cause

In MoveSelectionCommand, findNextRange() is called with its default isGoBack=true, which activates wrap-around logic at boundaries.

File: packages/sheets-ui/src/commands/commands/set-selection.command.ts (line 124)

Environment

  • Univer version: latest dev branch
  • Browser: All
  • OS: All

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions