Skip to content

[two_dimensional_scrollables] Fix pinned cells hit test#11777

Open
beroso wants to merge 5 commits into
flutter:mainfrom
beroso:fix/186876-pinned-cells-hit-test
Open

[two_dimensional_scrollables] Fix pinned cells hit test#11777
beroso wants to merge 5 commits into
flutter:mainfrom
beroso:fix/186876-pinned-cells-hit-test

Conversation

@beroso
Copy link
Copy Markdown
Contributor

@beroso beroso commented May 25, 2026

This fixes a bug where TableView trailing pinned cells lose hit tests to underlying cells.

List which issues are fixed by this PR. You must list at least one issue.
Fix flutter/flutter#186876

Pre-Review Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the gemini-code-assist bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.

Footnotes

  1. Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. 2

@google-cla
Copy link
Copy Markdown

google-cla Bot commented May 25, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@github-actions github-actions Bot added p: two_dimensional_scrollables Issues pertaining to the two_dimensional_scrollables package triage-framework Should be looked at in framework triage labels May 25, 2026
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request modifies RenderTableViewport to ensure hit testing correctly accounts for pinned areas by intersecting cell rectangles with section-specific clip rectangles. It introduces a _sectionClipRectFor method to calculate these bounds and adds regression tests to verify hit-test precedence for pinned cells. Review feedback suggests optimizing hit testing by using dual contains checks to avoid unnecessary object allocations and caching viewportDimension in _sectionClipRectFor to improve readability and performance.

Comment thread packages/two_dimensional_scrollables/lib/src/table_view/table.dart Outdated
Comment thread packages/two_dimensional_scrollables/lib/src/table_view/table.dart
@beroso beroso force-pushed the fix/186876-pinned-cells-hit-test branch from f3a106c to 782e898 Compare May 25, 2026 14:02
@beroso beroso force-pushed the fix/186876-pinned-cells-hit-test branch from b77e6e5 to ee38453 Compare May 25, 2026 14:32
@stuartmorgan-g stuartmorgan-g requested a review from Piinks May 26, 2026 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

p: two_dimensional_scrollables Issues pertaining to the two_dimensional_scrollables package triage-framework Should be looked at in framework triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[two_dimensional_scrollables] TableView trailing pinned columns lose hit tests to underlying cells

1 participant