fix: preserve IME composing in channel search and RSS import - #8
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
TextEditingController.texton every keystroke in the channel episode search field. That assignment clears IME composing and jumps the caret to the end, which broke WeChat 双拼 (typingysbecameyys, confirming 永辉 left the pinyin behind).StatelessWidgetthat constructed a new controller inbuildinto aStatefulWidgetwith a long-lived, disposed controller. Samecontroller.text = valuewrite-back is removed.Why
Third-party iOS IMEs (WeChat keyboard / 双拼) need the composing range to stay intact. Forcing
controller.textononChangedcommits composing and resets selection. Creating a controller inbuildalso drops text on any parent rebuild.Impact
Channel search and settings RSS import only. Discover search and login fields were already fine. No schema, API, signing, or store changes.
Validation
test/search_field_ime_test.dartcover composing, caret, and controller lifecycle. Run withflutter test test/search_field_ime_test.dart.yshvon a channel page and confirm 永辉; delete should not jump the caret to the end.