• Hassan Toor's avatar
    [web] - Fix broken `TextField` in semantics mode when it's a sibling of `Navigator` (#138446) · 59e892d3
    Hassan Toor authored
    When a `TextField` is rendered before a `Navigator`, it breaks in semantics mode.  This is because the framework generates the incorrect semantics tree (excludes the TextField) and when that tree gets sent to the engine, we don't get the signal to create the corresponding `<input>` element.
    
    This happens for a few reasons:
    * `ModalBarrier` uses `BlockSemantics` to drop the semantics of routes beneath the current route in `Navigator`
    * `ModalBarrier` mistakenly recognizes the widget outside of the `Navigator` to be its sibling
    *  So we end up dropping the semantics node of the `TextField` rendered before it. 
    
    The fix is to let `Navigator` generate a semantics node so that `ModalBarrier` doesn't mistakenly think widgets outside of `Navigator` are its siblings.  
    
    `Navigator` doesn't currently do this, which causes all the nodes generated from its widget subtree to be directly attached to the parent semantics node above `Navigator` - since this is also the parent of `TextField`, it considers them siblings. 
    
    Fixes https://github.com/flutter/flutter/issues/129324
    59e892d3
Name
Last commit
Last update
.github Loading commit data...
.vscode Loading commit data...
bin Loading commit data...
dev Loading commit data...
examples Loading commit data...
packages Loading commit data...
.ci.yaml Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
CODEOWNERS Loading commit data...
CODE_OF_CONDUCT.md Loading commit data...
CONTRIBUTING.md Loading commit data...
LICENSE Loading commit data...
PATENT_GRANT Loading commit data...
README.md Loading commit data...
TESTOWNERS Loading commit data...
analysis_options.yaml Loading commit data...
dartdoc_options.yaml Loading commit data...
flutter_console.bat Loading commit data...