Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[web] - Fix broken TextField in semantics mode when it's a sibling of Navigator #138446

Merged
merged 21 commits into from Jan 22, 2024

Conversation

htoor3
Copy link
Contributor

@htoor3 htoor3 commented Nov 14, 2023

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 #129324

Pre-launch Checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I read the [Tree Hygiene] wiki page, which explains my responsibilities.
  • I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement].
  • I signed the [CLA].
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is [test-exempt].
  • All existing and new tests are passing.

@github-actions github-actions bot added framework flutter/packages/flutter repository. See also f: labels. f: routes Navigator, Router, and related APIs. labels Nov 14, 2023
@htoor3 htoor3 requested a review from chunhtai November 14, 2023 22:59
Copy link
Contributor

@chunhtai chunhtai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@goderbauer
Copy link
Member

(triage): @htoor3 do you still have plans to submit this? Looks like its breaking some tests on CI.

@htoor3
Copy link
Contributor Author

htoor3 commented Dec 6, 2023

(triage): @htoor3 do you still have plans to submit this? Looks like its breaking some tests on CI.

yes, still have plans to submit this. Need to update a quite a few semantic tests since we're adding the Semantic node to Navigator. Will get to this today!

@flutter-dashboard
Copy link

This pull request executed golden file tests, but it has not been updated in a while (20+ days). Test results from Gold expire after as many days, so this pull request will need to be updated with a fresh commit in order to get results from Gold.

For more guidance, visit Writing a golden file test for package:flutter.

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

@github-actions github-actions bot added a: text input Entering text in a text field or keyboard related problems f: material design flutter/packages/flutter/material repository. a: accessibility Accessibility, e.g. VoiceOver or TalkBack. (aka a11y) f: cupertino flutter/packages/flutter/cupertino repository labels Jan 17, 2024
@github-actions github-actions bot added the a: tests "flutter test", flutter_test, or one of our tests label Jan 17, 2024
@htoor3 htoor3 requested a review from chunhtai January 18, 2024 02:00
Copy link
Contributor

@Renzo-Olivares Renzo-Olivares left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@htoor3 htoor3 added the autosubmit Merge PR when tree becomes green via auto submit App label Jan 22, 2024
@auto-submit auto-submit bot merged commit 59e892d into flutter:master Jan 22, 2024
61 checks passed
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 23, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 23, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 23, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 23, 2024
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Jan 23, 2024
flutter/flutter@3ee8ff2...5b673c2

2024-01-23 engine-flutter-autoroll@skia.org Roll Flutter Engine from fd0335a910b8 to b229878c57f5 (1 revision) (flutter/flutter#142051)
2024-01-23 goderbauer@google.com Remove unused clipBehavior from OverflowBar (flutter/flutter#141976)
2024-01-23 engine-flutter-autoroll@skia.org Roll Packages from e4cbf23 to 841fe90 (7 revisions) (flutter/flutter#142047)
2024-01-23 engine-flutter-autoroll@skia.org Roll Flutter Engine from d2855da628da to fd0335a910b8 (1 revision) (flutter/flutter#142046)
2024-01-23 leroux_bruno@yahoo.fr Add Share button to the SelectableRegion toolbar on Android (flutter/flutter#141447)
2024-01-23 davidmartos96@gmail.com Relax the warning of unavailable tokens in `gen_defaults` when a default value is provided (flutter/flutter#140872)
2024-01-23 engine-flutter-autoroll@skia.org Roll Flutter Engine from 37f68f6fc7fc to d2855da628da (1 revision) (flutter/flutter#142033)
2024-01-23 engine-flutter-autoroll@skia.org Roll Flutter Engine from 9e582c9032e5 to 37f68f6fc7fc (1 revision) (flutter/flutter#142027)
2024-01-23 engine-flutter-autoroll@skia.org Roll Flutter Engine from df6b15d35703 to 9e582c9032e5 (1 revision) (flutter/flutter#142026)
2024-01-23 engine-flutter-autoroll@skia.org Roll Flutter Engine from d3dbd4225e08 to df6b15d35703 (6 revisions) (flutter/flutter#142023)
2024-01-23 ian@hixie.ch Add a comment about how to test flutter_goldens (flutter/flutter#141902)
2024-01-23 ian@hixie.ch Enable contextMenuBuilder in the absence of selectionControls (flutter/flutter#141810)
2024-01-23 engine-flutter-autoroll@skia.org Roll Flutter Engine from b069d7f8f1fd to d3dbd4225e08 (3 revisions) (flutter/flutter#142005)
2024-01-23 98614782+auto-submit[bot]@users.noreply.github.com Reverts "hello_world app: migrate to Gradle Kotlin DSL" (flutter/flutter#142018)
2024-01-22 jmccandless@google.com Floating cursor docs (flutter/flutter#133002)
2024-01-22 git@reb0.org refactor: Rename filterPluginsByPlatform, cleanup Platform Strings (flutter/flutter#141780)
2024-01-22 barpac02@gmail.com hello_world app: migrate to Gradle Kotlin DSL (flutter/flutter#141541)
2024-01-22 engine-flutter-autoroll@skia.org Roll Flutter Engine from b2762f410840 to b069d7f8f1fd (4 revisions) (flutter/flutter#141993)
2024-01-22 matanlurey@users.noreply.github.com Remove duplicate code as suggested by natebosch. (flutter/flutter#141988)
2024-01-22 jesus_sguerrero@hotmail.com Revert "Remove hack from PageView." (flutter/flutter#141977)
2024-01-22 engine-flutter-autoroll@skia.org Roll Flutter Engine from d653559ae183 to b2762f410840 (3 revisions) (flutter/flutter#141978)
2024-01-22 matanlurey@users.noreply.github.com Do not hang on test failures of tests within `flutter_tools` (flutter/flutter#141821)
2024-01-22 gspencergoog@users.noreply.github.com Remove unneeded expectation in test (flutter/flutter#141822)
2024-01-22 engine-flutter-autoroll@skia.org Roll Flutter Engine from 1efe8ba6bc04 to d653559ae183 (3 revisions) (flutter/flutter#141972)
2024-01-22 ueman@users.noreply.github.com Add documentation which explains that `debugPrint` also logs in release mode (flutter/flutter#141595)
2024-01-22 tessertaha@gmail.com Fix `RangeSlider` throws a null-check error after `clearSemantics` is called (flutter/flutter#141965)
2024-01-22 engine-flutter-autoroll@skia.org Roll Flutter Engine from c49989292fc1 to 1efe8ba6bc04 (1 revision) (flutter/flutter#141969)
2024-01-22 110993981+htoor3@users.noreply.github.com [web] - Fix broken `TextField` in semantics mode when it's a sibling of `Navigator` (flutter/flutter#138446)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC bmparr@google.com,rmistry@google.com,stuartmorgan@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
@Jasguerrero
Copy link
Contributor

Reverting, PR breaking google testing b/322136071

@Jasguerrero Jasguerrero added the revert Autorevert PR (with "Reason for revert:" comment) label Jan 24, 2024
Copy link
Contributor

auto-submit bot commented Jan 24, 2024

Time to revert pull request flutter/flutter/138446 has elapsed.
You need to open the revert manually and process as a regular pull request.

@auto-submit auto-submit bot removed the revert Autorevert PR (with "Reason for revert:" comment) label Jan 24, 2024
auto-submit bot pushed a commit that referenced this pull request Jan 24, 2024
Jasguerrero added a commit to Jasguerrero/flutter that referenced this pull request Jan 24, 2024
auto-submit bot pushed a commit that referenced this pull request Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a: accessibility Accessibility, e.g. VoiceOver or TalkBack. (aka a11y) a: tests "flutter test", flutter_test, or one of our tests a: text input Entering text in a text field or keyboard related problems autosubmit Merge PR when tree becomes green via auto submit App f: cupertino flutter/packages/flutter/cupertino repository f: material design flutter/packages/flutter/material repository. f: routes Navigator, Router, and related APIs. framework flutter/packages/flutter repository. See also f: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Web] Unable to type in TextField when ensureSemantics is enabled for accessibility
5 participants