Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@justinmc
Copy link
Contributor

@justinmc justinmc commented Nov 28, 2018

Closes flutter/flutter#24276
Closes flutter/flutter#24555

This addresses a crash that happens when TextEditingController.clear is called on a field containing marked text. Marked text is unfinalized text from some input methods like Japanese kana.

textInRange was being called with a nonzero range when the text had already been cleared to an empty string. The problem was that selectionDidChange, which triggers a bunch of internal calls and eventually calls to textInRange, was being called before the marked range had been updated. This PR moves the marked range update first to avoid the problem.

screen shot 2018-11-28 at 9 21 44 am

@justinmc justinmc changed the title Japanese Clear Text Crash WIP jJapanese Clear Text Crash Nov 28, 2018
@justinmc justinmc changed the title WIP jJapanese Clear Text Crash WIP Japanese Clear Text Crash Nov 28, 2018
@justinmc
Copy link
Contributor Author

I'm working on a separate test for this in the flutter repo's driver tests.

@cbracken
Copy link
Member

Thanks for the super-clear PR description!

lgtm

@justinmc
Copy link
Contributor Author

justinmc commented Dec 4, 2018

I had wanted to write a regression test for this in the flutter repo's integration tests, but it seems not possible due to lack of marked text support. I opened an issue for now to point that out: flutter/flutter#24955

@justinmc justinmc merged commit 571f474 into flutter:master Dec 12, 2018
@justinmc justinmc deleted the japanese-text-crash branch December 12, 2018 23:32
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 13, 2018
goderbauer pushed a commit to flutter/flutter that referenced this pull request Dec 13, 2018
* 2bd75ae Support querying display refresh rate in engine (flutter/engine#7002)

* 793a08b Add .woff file to binary format (flutter/engine#7202)

* daf0ede Roll src/third_party/skia 6417060b1c23..340aeda6b3ba (41 commits) (flutter/engine#7205)

* 571f474 Update marked text before selection so textInRange is never called with (flutter/engine#6989)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants