Fix SelectableRegion crash when the selection starts in a scrollable child but does not select anything initially#184164
Closed
Renzo-Olivares wants to merge 10000 commits into
Closed
Conversation
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.
Fixes #115787
Before this change sometimes when starting a selection gesture such as a long press drag or a double tap drag directly on the empty padding of a
Scrollablethe selection may not be set initially because there was nothing to select in the empty padding. This caused a crash when receiving subsequent edge update events because we believe the selection starts in the scrollable but we do not have any selection edges set.To fix this I made
_selectionStartsInScrollablenullable, this way a subsequent selection edge will not try to set_selectionStartsInScrollableagain if it has already been set removing the need for the assert.handleSelectionEdgeUpdatepreviously assumed that if the cached edges were not set then we should set_selectionStartsInScrollable, the assert was used to verify that_selectionStartsInScrollablewas false i.e. had not been set/changed from its initial value. By making_selectionStartsInScrollablenullable we can ensure a subsequent edge update event does not re-set the value if it has already been set previously.Pre-launch Checklist
///).