• Renzo Olivares's avatar
    handleSelectWord in MultiSelectableSelectionContainerDelegate should handle... · 0e1056f8
    Renzo Olivares authored
    handleSelectWord in MultiSelectableSelectionContainerDelegate should handle rects inside of rects (#127478)
    
    Fixes #127076
    
    Sometimes a `Selectable`s rect may contain another `Selectable`s rect within it. In the case of `handleSelectWord` when choosing which `Selectable` to dispatch the `SelectionEvent` to, the event would be dispatched to the wrong `Selectable` causing an assertion error to be thrown. 
    
    <img width="577" alt="Screenshot 2023-05-24 at 2 46 13 AM" src="https://github.com/flutter/flutter/assets/948037/bb246966-acad-4d81-bd87-758c3ea6ea39">
    
    In the picture above the red outline shows the rect of a two-line piece of text. And the blue rect shows the rect of a piece of text that is on the second line of the two-line piece of text, but has been separated into its own rect for some case, for example when `TextSpan`s are separated by a `WidgetSpan`.
    
    We should check if the text layout of the selectable that has been dispatched the SelectionEvent contains the word, if not then return `SelectionResult.next`, and continue to look through the list of selectables.
    0e1056f8
Name
Last commit
Last update
..
lib Loading commit data...
test Loading commit data...
test_fixes Loading commit data...
test_private Loading commit data...
test_profile Loading commit data...
test_release Loading commit data...
LICENSE Loading commit data...
README.md Loading commit data...
analysis_options.yaml Loading commit data...
build.yaml Loading commit data...
dart_test.yaml Loading commit data...
pubspec.yaml Loading commit data...