Skip to content

fix: canvas tables that only just fit flicker between scrollbar states every frame (scrollbar-gutter) - #10264

Open
nishantmonu51 wants to merge 1 commit into
mainfrom
nishant/fix-canvas-table-scrollbar-loop
Open

nishantmonu51 wants to merge 1 commit into
mainfrom
nishant/fix-canvas-table-scrollbar-loop

Conversation

@nishantmonu51

Copy link
Copy Markdown
Collaborator

With classic (always-visible) scrollbars, such as on Windows or on macOS with "Show scroll bars: Always" or a mouse attached, a canvas table or pivot whose rows only just fit its widget redraws on every frame. It switches between a layout without scrollbars and one with both scrollbars, so the table flickers continuously.

Steps to reproduce

  1. Use Chrome with classic scrollbars.
  2. On a canvas, add a pivot with a few rows, and set the row height so the table fits only without a horizontal scrollbar (within 15 px of its content height).
  3. The table flickers. The wrapper's client size changes on every animation frame, alternating between "fits, no scrollbars" and "both scrollbars".

What the fix does

  • Canvas tables fill the wrapper's client width (fillWidth, with bind:clientWidth read on each border-box resize). A vertical scrollbar narrows that width, so the table loops:
    • Columns sized for the full width overflow once the vertical scrollbar shows, and a horizontal scrollbar appears.
    • The horizontal scrollbar grows the wrapper to its maximum height. That resize refits the columns to the narrower width.
    • Both scrollbars then go away, the wrapper shrinks, and the next resize widens the columns again.
  • scrollbar-gutter: stable on the fill-width wrapper reserves the scrollbar's space, so the client width no longer depends on whether the scrollbar shows.
    • Overlay scrollbars (the macOS default) take no space and are unaffected.
    • With classic scrollbars, a table that does not scroll keeps an empty strip the width of the scrollbar on its right.
  • Only canvas tables fill their width. The Explore pivot is unchanged.
  • Checked in Chrome with 15 px scrollbars, across row heights from 236 to 276 px at four widths: before the change the pivot looped at 14 of those sizes, and after it looped at none.

Separate from #10263, which fixes scrolled tables losing their rows on canvas refreshes.

Checklist:

  • Covered by tests
  • Ran it and it works as intended
  • Reviewed the diff before requesting a review
  • Checked for unhandled edge cases
  • Linked the issues it closes
  • Checked if the docs need to be updated. If so, create a separate Linear DOCS issue
  • Intend to cherry-pick into the release branch
  • I'm proud of this work!

…s every frame

With classic (always-visible) scrollbars, a canvas table fills its wrapper's
client width, which the vertical scrollbar narrows when it appears.
A table that fits only without scrollbars then loops: columns sized for the
full width overflow once the vertical scrollbar shows, the horizontal
scrollbar grows the wrapper, the resize refits the columns to the narrower
width, both scrollbars go away, and the next resize widens the columns again.

`scrollbar-gutter: stable` on the fill-width wrapper reserves the scrollbar's
space, so the client width no longer depends on the scrollbar.
@nishantmonu51 nishantmonu51 added Type:Bug Something isn't working Area:Pivot Size:S Small change: under 100 lines Area:Canvas Canvas dashboards labels Dec 2, 2026

This branch has not been deployed

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

Labels

Area:Canvas Canvas dashboards Area:Pivot Size:S Small change: under 100 lines Type:Bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant