Skip to content

Selection highlight disappears or overlaps frozen cells when scrolling #39

Closed

Description

@JueyingLi

Thanks for maintaining react-xlsx! We use it to preview workbooks and would like to contribute a focused fix for selection rendering with frozen panes.

Reproduction

Reproduced in the upstream playground on main at 434e5a6 (package version 0.17.2), using the default canvas renderer. The attached synthetic workbook contains only cell-address labels, with the first two rows and columns frozen.

  1. Open the attached workbook in the playground (Insert → Open).
  2. Select B2, then scroll vertically. B2 remains visible in the frozen corner, but its selection outline disappears. The name box still shows B2.
  3. Scroll back to the top. Select B2:E7 by dragging, then scroll down slightly. The range highlight moves over frozen cells that are outside the selected range instead of remaining aligned with the visible selected cells.

Expected behavior

Frozen portions of a selection should remain anchored to their cells. Scrolling portions should move with the worksheet and be clipped at frozen-pane boundaries. This should also work for a range crossing both boundaries.

Why this matters

The outline is how users identify which data they selected. Losing it, or painting it over different cells, makes workbook inspection confusing and can make the wrong data appear selected.

Investigation / proposed contribution

Worksheet rendering already separates frozen and scrolling panes. The selection uses a single absolute overlay, so it does not follow the same pane positioning and clipping. We have a downstream workaround for 0.15.0. The source-level fix against current main is available in #40.

Evidence

The recordings focus on one interaction: select B2, then gradually scroll down. Watch the blue outline around B2; the cell remains visible in the frozen corner and the name box continues to show B2.

The first recording shows the bug on unmodified upstream. The second compares upstream (top) with the local source fix (bottom), using the same workbook and actions. Captions explain each step. The recordings demonstrate the single-cell B2 case. Manual visual checks also covered B2:E7, spanning frozen and scrolling cells across both boundaries.

frozen-selection.xlsx

Bug reproduction (unmodified upstream)

frozen-selection-before-clear.mp4

Before / after comparison (upstream above, local fix below)

frozen-selection-comparison.mp4

Activity

  1. JueyingLi commented on Oct 14, 2026

    @JueyingLi
    ContributorAuthor

    The source fix is now in PR #40: #40.

    Branch: JueyingLi/react-xlsx:fix/frozen-selection.

    The PR reuses the existing pane bounds and viewport transforms for canvas selection outlines and fill handles. The captioned recordings above compare unmodified upstream with this fix. Type checking, all 30 existing tests, and the package build passed.

  2. andrewlu0 commented on Oct 19, 2026

    @andrewlu0
    Collaborator

    thank you, just merged, will cut a patch release

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

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