Reverts "Fix focus management for text fields (#51009)" (flutter/engine#53502)
Reverts: flutter/engine#51009
Initiated by: jiahaog
Reason for reverting: This causes b/348598454. We're getting test failures with stack traces like the following after this PR:
```
Cannot get renderObject of inactive element.
In order for an element to have a valid renderObject, it must be active, which means it is part of the tree.
Instead, this element is in the _ElementLifecycle.inactive state.
If you called this method from a State object, consider guarding
```
Original PR Author: tugorez
Reviewed By: {mdebbar}
This change reverts the following previous change:
Fix focus management for text fields
This PR:
1. Refactors the DOM `focus` function to take [options][1]
2. Removes the timers sorrounding the `activeDomElement.focus()` so that the input elements get focused as immediate as possible.
3. Prevents the default on pointerdown in a Flutter View and schedules a `requestViewFocusChange` to claim focus in that view after some time. This gives `2` the opportunity to focus the right `<input />` or `<textarea />` element. This helps focus correctly transition from one input element to another (without jumping to a flutter view in between).
4. Deactivating a `TextField` doesn't blur the focused element anymore, it insteads schedules for later a call to move the focus to the flutter view if nothing inside it claimed focus first.
5. Prevents scroll in all the focus calls (this should help with the view jumping when focusing one text field after another).
## Sample apps
1. Full screen mode: https://tugorez.com/flutter_focus_web
2. Embedded mode: https://tugorez.com/flutter_focus_web?embedded
[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
6 files changed
tree: d4323e80812701b34da7323a0b8b0b994dcbb98c
- engine/
- DEPS