Skip to content

[material_ui] Fix dismissal near minimum extent when shouldCloseOnMinExtent - #12545

Merged
auto-submit[bot] merged 2 commits into
flutter:mainfrom
kirya355:decoupling-port-190810
Nov 4, 2026
Merged

auto-submit[bot] merged 2 commits into
flutter:mainfrom
kirya355:decoupling-port-190810

Conversation

@kirya355

@kirya355 kirya355 commented Aug 22, 2026 •

Copy link
Copy Markdown
Contributor

This PR ports flutter/flutter#190810 by @kirya355 from flutter/flutter to flutter/packages.

Fixes bottom sheet dismissal when a DraggableScrollableNotification extent
is within floating-point precision of minExtent, instead of requiring exact
equality.

Updates both the modal BottomSheet and standard Scaffold bottom sheet
handlers. Adds regression tests for both paths using extent: 0.20000000001
and minExtent: 0.2.

This PR fix flutter/flutter#116982

Pre-Review Checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I read the [AI contribution guidelines] and understand my responsibilities, or I am not using AI tools.
  • I read the [Tree Hygiene] page, which explains my responsibilities.
  • I read and followed the [relevant style guides] and ran [the auto-formatter].
  • I signed the [CLA].
  • The title of the PR starts with the name of the package surrounded by square brackets, e.g. [shared_preferences]
  • I [linked to at least one issue that this PR fixes] in the description above.
  • I followed [the version and CHANGELOG instructions], using [semantic versioning] and the [repository CHANGELOG style], or I have commented below to indicate which documented exception this PR falls under[^1].
  • I updated/added any relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or I have commented below to indicate which [test exemption] this PR falls under[^1].
  • All existing and new tests are passing.

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

Copy link
Copy Markdown
Contributor

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 updates the bottom sheet dismissal logic in bottom_sheet.dart and scaffold.dart to check if the difference between the current extent and the minimum extent is within precisionErrorTolerance, rather than using direct equality. It also adds unit tests to verify this behavior and a pending changelog entry. The review feedback suggests removing the .abs() call from the tolerance check to ensure the bottom sheet still closes if the extent is dragged or animated below the minimum extent.

@QuncCccccc

Copy link
Copy Markdown
Contributor

Thanks for your contribution! Could you make sure the PR description includes the "Pre-launch Checklist" and all items are checked:)?

@QuncCccccc
QuncCccccc self-requested a review August 24, 2026 18:46
@kirya355

Copy link
Copy Markdown
Contributor Author

Hi @QuncCccccc !
Done! I've updated the description with the Pre-launch Checklist and checked all the items.

@elliette elliette changed the title [material_ui] Port flutter/flutter #190810 fix dismissal near minimum extent when shouldCloseOnMinExtent [material_ui] Fix dismissal near minimum extent when shouldCloseOnMinExtent Sep 1, 2026
@QuncCccccc QuncCccccc added the CICD Run CI/CD label Sep 14, 2026
@QuncCccccc
QuncCccccc force-pushed the decoupling-port-190810 branch from 6913a2c to 45cd25b Compare September 14, 2026 23:33
@flutter-dashboard flutter-dashboard Bot removed the CICD Run CI/CD label Sep 14, 2026
@QuncCccccc QuncCccccc added the CICD Run CI/CD label Sep 14, 2026

@QuncCccccc QuncCccccc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM. Thanks for your contribution:)

@QuncCccccc
QuncCccccc requested a review from elliette October 6, 2026 21:37

@elliette elliette left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It looks like you might have forgotten to link an issue (see checklist item I linked to at least one issue that this PR fixes in the description above). Do you mind adding the issue you are fixing to the PR description? Thank you!

@elliette elliette added the waiting for response The Flutter team cannot make further progress on this PR until the author responds label Oct 27, 2026
@kirya355

kirya355 commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor Author

It looks like you might have forgotten to link an issue (see checklist item I linked to at least one issue that this PR fixes in the description above). Do you mind adding the issue you are fixing to the PR description? Thank you!

Thanks for the review! I found flutter/flutter#116982, which describes the same problem. Although it was closed by flutter/flutter#165557, I still encountered the issue after that fix: with snapping and shouldCloseOnMinExtent enabled, the sheet could snap to its minimum extent without closing.

This PR fixes the remaining case.

@kirya355
kirya355 requested a review from elliette November 4, 2026 07:19
@github-actions github-actions Bot removed the waiting for response The Flutter team cannot make further progress on this PR until the author responds label Nov 4, 2026

@elliette elliette left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you for linking the issue, LGTM!

@flutter-dashboard flutter-dashboard Bot removed the CICD Run CI/CD label Nov 4, 2026
@elliette elliette added CICD Run CI/CD autosubmit Merge PR when tree becomes green via auto submit App labels Nov 4, 2026
@auto-submit
auto-submit Bot merged commit 2c2b1e7 into flutter:main Nov 4, 2026
14 checks passed
bkonyi pushed a commit to bkonyi/flutter that referenced this pull request Nov 5, 2026
flutter/packages@670b30e...0478162

2026-11-05 [email protected] [material_ui] Document RefreshIndicator mouse
behavior on desktop and web (flutter/packages#13286)
2026-11-05 [email protected] [material_ui] Make
SearchAnchor.bar respect SearchBarThemeData padding
(flutter/packages#13360)
2026-11-04 [email protected] [pointer_interceptor] Use
dart.library.js_interop in example export (flutter/packages#13558)
2026-11-04 [email protected] [in_app_purchase_storekit] Use
purchase(confirmIn:) for StoreKit 2 purchases (flutter/packages#13410)
2026-11-04 [email protected] [material_ui] Fix
dismissal near minimum extent when shouldCloseOnMinExtent
(flutter/packages#12545)
2026-11-04 [email protected] [material_ui]
Add Material 3 Expressive `ElevatedButton` (flutter/packages#13084)
2026-11-04 [email protected] [go_router]
Stop inactive StatefulShellRoute branches from vetoing pops
(flutter/packages#12972)
2026-11-04 [email protected] Manual roll Flutter (stable)
from abaf9c5 to c197ca5 (14 revisions)
(flutter/packages#13542)
2026-11-04 [email protected] [in_app_purchase] Convert example app
to Swift (flutter/packages#13556)
2026-11-04 [email protected] Sync release-go_router-18.1.3 to
main (flutter/packages#13559)
2026-11-04 [email protected] Sync release-material_ui-1.10.0 to
main (flutter/packages#13546)
2026-11-04 [email protected]
[camera_android_camerax] Add magic number guideline to `TESTING.md`
(flutter/packages#13081)
2026-11-04 [email protected] Sync release-cupertino_ui-1.1.6 to
main (flutter/packages#13547)
2026-11-04 [email protected] [file_selector] Convert unit tests to
Kotlin (flutter/packages#13102)
2026-11-04 [email protected] Roll Flutter from
9347202 to 3623d2d (25 revisions) (flutter/packages#13555)

If this roll has caused a breakage, revert this CL and set the roller
to dry run mode using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC [email protected] on the revert to ensure that a
human
is aware of the problem.

To file a bug in Flutter:
https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App CICD Run CI/CD p: material_ui triage-design Should be looked at in design triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DraggableScrollableSheet from showModalBottomSheet snaps to unspecified extent

3 participants