Skip to content

Commit 744b1a7

Browse files
committed
fix: Prevent tab bar animation during pull-to-refresh overscroll and update hit test behavior in iOS 26 native toolbar
1 parent 3dd499f commit 744b1a7

File tree

4 files changed

+21
-3
lines changed

4 files changed

+21
-3
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
* Supports 70+ languages automatically based on system locale
77
* **FIX**: Increased default height of AdaptiveSegmentedControl from 32 to 36 pixels to prevent overflow on iOS <26
88
* Resolves RenderConstraintsTransformBox overflow issue with CupertinoSlidingSegmentedControl
9+
* **FIX**: Fixed tab bar minimizing during pull-to-refresh bounce animation
10+
* Tab bar now ignores scroll events when content is overscrolling (pixels outside minScrollExtent/maxScrollExtent)
11+
* Prevents unwanted tab bar animation during iOS elastic scroll bounce
912

1013
## [0.1.95]
1114
* **NEW**: Added `AdaptiveTabBarView` widget - Platform-specific swipeable tab bar view with color customization

lib/src/widgets/adaptive_alert_dialog.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,9 @@ class AdaptiveAlertDialog {
260260
final normalActions = actions
261261
.where((a) => a.style != AlertActionStyle.cancel)
262262
.toList();
263-
final cancelLabel = MaterialLocalizations.of(context).cancelButtonLabel;
263+
final cancelLabel = MaterialLocalizations.of(
264+
context,
265+
).cancelButtonLabel;
264266
final cancelAction = actions.firstWhere(
265267
(a) => a.style == AlertActionStyle.cancel,
266268
orElse: () => AlertAction(

lib/src/widgets/adaptive_scaffold.dart

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -671,6 +671,19 @@ class _MinimizableTabBarState extends State<_MinimizableTabBar>
671671

672672
if (notification is ScrollUpdateNotification) {
673673
final delta = notification.scrollDelta ?? 0;
674+
final metrics = notification.metrics;
675+
676+
// Check if we're in overscroll territory (pull-to-refresh or bottom bounce)
677+
// When pixels < minScrollExtent, user is pulling down beyond top (overscroll)
678+
// When pixels > maxScrollExtent, user is pulling up beyond bottom (overscroll)
679+
final isOverscrolling =
680+
metrics.pixels < metrics.minScrollExtent ||
681+
metrics.pixels > metrics.maxScrollExtent;
682+
683+
// Ignore scroll events during overscroll to prevent tab bar animation during bounce
684+
if (isOverscrolling) {
685+
return;
686+
}
674687

675688
if (widget.minimizeBehavior == TabBarMinimizeBehavior.onScrollDown ||
676689
widget.minimizeBehavior == TabBarMinimizeBehavior.automatic) {

lib/src/widgets/ios26/ios26_native_toolbar.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class _IOS26NativeToolbarState extends State<IOS26NativeToolbar> {
8383
creationParams: creationParams,
8484
creationParamsCodec: const StandardMessageCodec(),
8585
onPlatformViewCreated: _onPlatformViewCreated,
86-
hitTestBehavior: PlatformViewHitTestBehavior.opaque,
86+
hitTestBehavior: PlatformViewHitTestBehavior.translucent,
8787
// Enable Hybrid Composition mode for better layer integration
8888
gestureRecognizers: const <Factory<OneSequenceGestureRecognizer>>{},
8989
),
@@ -102,7 +102,7 @@ class _IOS26NativeToolbarState extends State<IOS26NativeToolbar> {
102102
bottom: 0,
103103
child: Align(
104104
alignment: Alignment.centerLeft,
105-
child: widget.leading!,
105+
child: IgnorePointer(ignoring: false, child: widget.leading!),
106106
),
107107
),
108108
],

0 commit comments

Comments
 (0)