Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Momentum scrolling continues despite press and hold in list view #196

Merged
merged 3 commits into from
Jul 21, 2024

Use shouldIgnorePointer of scroll position

00539af
Select commit
Loading
Failed to load commit list.
Sign in for the full log view
Merged

Fix: Momentum scrolling continues despite press and hold in list view #196

Use shouldIgnorePointer of scroll position
00539af
Select commit
Loading
Failed to load commit list.
GitHub Actions / Test Report succeeded Jul 21, 2024 in 0s

44 passed, 0 failed and 0 skipped

Tests passed successfully

✅ /home/runner/work/smooth_sheets/smooth_sheets/flutter-test-report.json

44 tests were completed in 11s with 44 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
package/test/draggable/draggable_sheet_test.dart 4✅ 986ms
package/test/foundation/physics_test.dart 20✅ 101ms
package/test/foundation/sheet_notification_test.dart 3✅ 345ms
package/test/foundation/sheet_viewport_test.dart 4✅ 496ms
package/test/navigation/navigation_sheet_test.dart 8✅ 2s
package/test/scrollable/scrollable_sheet_test.dart 5✅ 1s

✅ package/test/draggable/draggable_sheet_test.dart

✅ Inherited controller should be attached
✅ Opening keyboard does not interrupt sheet animation
SheetKeyboardDismissible
  ✅ should dismiss the keyboard when dragging
  ✅ should dismiss the keyboard when scrolling

✅ package/test/foundation/physics_test.dart

✅ FixedBouncingBehavior returns same value for same input metrics
✅ DirectionAwareBouncingBehavior respects gesture direction
SheetPhysics subclasses
  ✅ can create dynamic inheritance relationships
Default configuration of SheetPhysics
  ✅ does not allow over/under dragging
  ✅ does not apply any resistance if position is in bounds
  ✅ prevents position from going out of bounds
  ✅ creates no ballistic simulation if position is in bounds
  ✅ creates ballistic simulation which ends at the nearest edge
  ✅ creates no settling simulation if the position is in bounds
  ✅ creates settling simulation which ends at nearest edge
SnapToNearestEdge
  ✅ snaps to nearest edge if velocity is small enough
  ✅ is aware of fling gesture direction
  ✅ is disabled if position is out of bounds
SnapToNearest
  ✅ snaps to nearest edge if velocity is small enough
  ✅ is aware of fling gesture direction
  ✅ is disabled if position is out of bounds
BouncingSheetPhysics
  ✅ progressively applies friction if position is out of bounds
  ✅ does not allow to go beyond bounceable bounds
  ✅ applies friction even if position is on boundary
  ✅ can apply a reasonable friction to extremely large offset

✅ package/test/foundation/sheet_notification_test.dart

✅ Drag gesture should dispatch drag start/update/end notifications in sequence
✅ Sheet animation should dispatch metrics update notifications
✅ Over-darg gesture should dispatch both darg and overflow notifications

✅ package/test/foundation/sheet_viewport_test.dart

Ignore pointer test:
  ✅ pointer events on a sheet should be ignored if activity says to do so
  ✅ content in a sheet should receive pointer events if activity allows
  ✅ content obscured by a sheet should never receive pointer events
  ✅ content not obscured by a sheet should always receive pointer events

✅ package/test/navigation/navigation_sheet_test.dart

✅ Attached controller emits correct pixel values when dragging
✅ Attached controller emits correct boundary values
✅ Inherited controller should be attached
✅ Works with DropdownButton without crashing
✅ Opening keyboard does not interrupts sheet animation
✅ Drag gestures should be ignored during a page transition
SheetKeyboardDismissible
  ✅ should dismiss the keyboard when dragging
  ✅ should dismiss the keyboard when scrolling

✅ package/test/scrollable/scrollable_sheet_test.dart

✅ Inherited controller should be attached
✅ Opening keyboard does not interrupt sheet animation
✅ Press and hold scrollable view should stop momentum scrolling
SheetKeyboardDismissible
  ✅ should dismiss the keyboard when dragging
  ✅ should dismiss the keyboard when scrolling