fix: SelectableRegion should only finalize selection after changing#159698
Merged
auto-submit[bot] merged 2 commits intoflutter:masterfrom Dec 10, 2024
Merged
Conversation
dfdfe23 to
270846f
Compare
added 2 commits
December 2, 2024 22:17
…ever changed the selection, for example a single tap + drag on mobile platforms does not change the selection and should not dispatch a finalized notification
270846f to
7a20c65
Compare
justinmc
approved these changes
Dec 10, 2024
Comment on lines
+544
to
+550
| void _finalizeSelectableRegionStatus() { | ||
| if (_selectionStatusNotifier.value != SelectableRegionSelectionStatus.changing) { | ||
| // Don't finalize the selection again if it is not currently changing. | ||
| return; | ||
| } | ||
| _selectionStatusNotifier.value = SelectableRegionSelectionStatus.finalized; | ||
| } |
Contributor
There was a problem hiding this comment.
There is still a risk that someone will edit this class in the future and directly set the status to finalized without realizing that they should have used this method instead. However, I can't think of a better way to do it right now 🤷
Contributor
There was a problem hiding this comment.
I take that back, you have that covered with the assert in the setter below, nice!
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Dec 10, 2024
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Dec 10, 2024
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Dec 10, 2024
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Dec 10, 2024
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Dec 10, 2024
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Dec 11, 2024
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Dec 11, 2024
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Dec 11, 2024
11 tasks
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Feb 12, 2025
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Feb 13, 2025
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Feb 13, 2025
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Mar 6, 2025
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Mar 7, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There are some cases where selection behavior varies on a given platform by the pointer device, for example dragging to select changes on mobile platforms depending on whether a mouse or a touch is used. When a mouse is used a user can drag to select normally, when a touch is used the selection does not change on mobile platforms when dragging.
Before this change at the end of a touch drag users would still be notified the selection was finalized even though nothing changed and they had not previously received a
changingnotification. After this change the selection is no longer finalized unless theSelectableRegionSelectionStatuswas previously in achangingstate.Pre-launch Checklist
///).