• 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
..
fix_data Loading commit data...
src Loading commit data...
analysis_options.yaml Loading commit data...
analysis_options_user.yaml Loading commit data...
animation.dart Loading commit data...
cupertino.dart Loading commit data...
foundation.dart Loading commit data...
gestures.dart Loading commit data...
material.dart Loading commit data...
painting.dart Loading commit data...
physics.dart Loading commit data...
rendering.dart Loading commit data...
scheduler.dart Loading commit data...
semantics.dart Loading commit data...
services.dart Loading commit data...
widgets.dart Loading commit data...