Fix selecting backwards when involving widget spans#184031
Closed
Renzo-Olivares wants to merge 10000 commits into
Closed
Fix selecting backwards when involving widget spans#184031Renzo-Olivares wants to merge 10000 commits into
Renzo-Olivares wants to merge 10000 commits into
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 #166462
Before this change
_initSelectionwould always begin its selection search at index 0, this caused issues when selecting backwards and the children of the selection delegate also contained children. This happens because when we select backwards and always start our selection search at index 0, if our pointer moves backwards from point b to point a and point a is already on index 0 (of a selection container with N selectables), the selection logic will short-circuit early thinking we found the selection, skipping any selectables in between point b and point a.After this change
_initSelectionwill begin its selection search at the opposite edge if it exists. This fixes the issue because when entering a new selectable, while dragging backwards and updating the end edge, first the selectable will callensureChildUpdatedand synthesize a start edge. Then it processes the end edge event and begins to search for that selection edge, we now start this search at the opposite edge which allows us ensure all items between both edges are visited so we can create a continuous selection.Pre-launch Checklist
///).