Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/two_dimensional_scrollables/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.3.9

* Fix hit testing issue when horizontally scrolled.

## 0.3.8

* Updates minimum supported SDK version to Flutter 3.35/Dart 3.9.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ class RenderTreeViewport extends RenderTwoDimensionalViewport {
}
final Rect rowRect =
parentData.paintOffset! &
Size(viewportDimension.width, row.size.height);
Size(row.size.width, row.size.height);
Comment on lines 163 to +165

Choose a reason for hiding this comment

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

medium

This change correctly fixes the hit testing issue for horizontally scrolled content. However, there doesn't appear to be a new test case that covers this specific scenario. To prevent regressions, it would be beneficial to add a test that:

  1. Creates a TreeView with a row wider than the viewport.
  2. Scrolls horizontally to reveal the overflowed part of the row.
  3. Taps on the overflowed part and asserts that the tap is correctly handled.

This would ensure the fix is working as expected and remains stable in the future.

References
  1. The repository style guide states that code changes should have appropriate tests. (link)

if (rowRect.contains(position)) {
result.addWithPaintOffset(
offset: parentData.paintOffset,
Expand Down
2 changes: 1 addition & 1 deletion packages/two_dimensional_scrollables/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: two_dimensional_scrollables
description: Widgets that scroll using the two dimensional scrolling foundation.
version: 0.3.8
version: 0.3.9
repository: https://github.com/flutter/packages/tree/main/packages/two_dimensional_scrollables
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+two_dimensional_scrollables%22+

Expand Down