-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Fix crash when text editing value changes between scrolls #179163
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
Fix crash when text editing value changes between scrolls #179163
Conversation
ecfdb6b to
109e411
Compare
justinmc
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
One nit: Are you sure it's worth it to include tests for TextField and CupertinoTextField, or do the tests on EditableText cover everything already?
|
@justinmc I wasn't too sure about this. My reasoning was that while the |
|
I personally lean towards repeating the test in the Cupertino and Material libraries. The main drawback is increased maintenance burden, but in this case the increased burden appears to be acceptable. I don't feel strongly about this though and would be happy to defer to whatever y'all think is best :) |
|
I'm on board with keeping the duplicated tests! Seems like the bug was reported in TextField so it's probably good to have a specific regression test for that, among the other reasons you guys gave above. |
flutter/flutter@5545bb3...e274574 2025-12-03 engine-flutter-autoroll@skia.org Roll Skia from 20829e37dfb8 to db4c79d41513 (1 revision) (flutter/flutter#179401) 2025-12-03 engine-flutter-autoroll@skia.org Roll Skia from adc7ea94cada to 20829e37dfb8 (6 revisions) (flutter/flutter#179385) 2025-12-03 pateltirth454@gmail.com Refactor GetShaderClipDepth for clarity (flutter/flutter#179110) 2025-12-03 engine-flutter-autoroll@skia.org Roll Skia from 3b339a83959b to adc7ea94cada (1 revision) (flutter/flutter#179376) 2025-12-03 engine-flutter-autoroll@skia.org Roll Dart SDK from eb743a1d4ade to 0bb365d7ac74 (7 revisions) (flutter/flutter#179372) 2025-12-03 nebkat@gmail.com feat: Add `mainAxisExtent` parameter to `GridView` constructors (flutter/flutter#176927) 2025-12-03 engine-flutter-autoroll@skia.org Roll Skia from eb01fff20df8 to 3b339a83959b (4 revisions) (flutter/flutter#179371) 2025-12-02 rmolivares@renzo-olivares.dev Fix crash when text editing value changes between scrolls (flutter/flutter#179163) 2025-12-02 engine-flutter-autoroll@skia.org Roll Skia from 6bd3b06b1e08 to eb01fff20df8 (3 revisions) (flutter/flutter#179362) 2025-12-02 timmaffett@gmail.com Adds Impellerc flatbuffer format versioning. (flutter/flutter#175470) 2025-12-02 30870216+gaaclarke@users.noreply.github.com Adds format argument to Picture.toImageSync (flutter/flutter#178691) 2025-12-02 6655696+guidezpl@users.noreply.github.com Delete disabled workflow and add missing permissions key to workflow (flutter/flutter#178911) 2025-12-02 mdebbar@google.com [web] Fix some gn warnings (flutter/flutter#178313) 2025-12-02 engine-flutter-autoroll@skia.org Roll Skia from 45337c4e919d to 6bd3b06b1e08 (4 revisions) (flutter/flutter#179353) 2025-12-02 louisehsu@google.com [ios] Reland Dynamic Content Resizing (flutter/flutter#179153) 2025-12-02 sokolovskyi.konstantin@gmail.com [web] Fix onTextScaleFactorChanged not getting called. (flutter/flutter#178862) 2025-12-02 engine-flutter-autoroll@skia.org Roll Packages from c8be05d to 148dcd2 (9 revisions) (flutter/flutter#179343) 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 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
…9163) This change fixes a crash in `EditableText` that occurs when the text editing value changes between two scrolls, when the second scroll ends `_dataWhenToolbarShowScheduled` will be invalidated. If the second scroll ends before the post frame callback scheduled by the first scroll has a chance to execute, there will be a crash because `_dataWhenToolbarShowScheduled` is being accessed while null. This change also invalidates a scheduled toolbar if the text editing value has changed before the post-frame callback has a chance to run. Fixes flutter#179164 ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing. --------- Co-authored-by: Renzo Olivares <roliv@google.com>
This change fixes a crash in
EditableTextthat occurs when the text editing value changes between two scrolls, when the second scroll ends_dataWhenToolbarShowScheduledwill be invalidated. If the second scroll ends before the post frame callback scheduled by the first scroll has a chance to execute, there will be a crash because_dataWhenToolbarShowScheduledis being accessed while null.This change also invalidates a scheduled toolbar if the text editing value has changed before the post-frame callback has a chance to run.
Fixes #179164
Pre-launch Checklist
///).