fix(TInput): password input keyboard issues on focus switch (#763)#928
Open
jamesliauw8-rgb wants to merge 2 commits into
Open
fix(TInput): password input keyboard issues on focus switch (#763)#928jamesliauw8-rgb wants to merge 2 commits into
jamesliauw8-rgb wants to merge 2 commits into
Conversation
) Fixes the following issue reported in Tencent#763: Switching focus between two TInput password fields causes the soft keyboard to be dismissed instead of staying open (Android). Root cause: TInputView passed onTapOutside straight through to TextField; when callers do not provide one, Flutter's default _defaultOnTapOutside unfocuses the current field, racing with the next field's requestFocus and causing the keyboard to flicker shut. Changes: - TInput: label-area GestureDetector now uses HitTestBehavior. translucent and forwards an explicit onLabelTap, so taps fall through to the underlying TextField when no label handler is supplied. - TInput / TInputView: add new optional autofillHints parameter and forward it to TextField for proper system password autofill support. - TInputView: provide a no-op default onTapOutside so switching between multiple TInputs no longer dismisses the soft keyboard. Callers can still override it to restore the dismiss-on-tap- outside behaviour. - example: add a login-style demo with two consecutive password inputs to manually verify the fix. - test: add 7 widget tests under test/input/ covering all fix points (all passing). Verified on: - iOS 17 (manual + automated tests) - Android MIUI (Redmi, manual): focus-switch fix is effective. Known upstream limitation (out of scope): On MIUI / HyperOS, even a bare Flutter TextField(obscureText: true) requires two taps to bring up the IME on first interaction. This is a Flutter Engine + vendor IME compatibility issue and cannot be worked around in Dart-layer component code.
Member
|
williamliao seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
Contributor
📱 APK 下载 |
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.

Fixes the following issue reported in #763:
Switching focus between two TInput password fields causes the soft keyboard to be dismissed instead of staying open (Android).
Root cause:
TInputView passed onTapOutside straight through to TextField; when
callers do not provide one, Flutter's default _defaultOnTapOutside
unfocuses the current field, racing with the next field's
requestFocus and causing the keyboard to flicker shut.
Changes:
Verified on:
Known upstream limitation (out of scope):
On MIUI / HyperOS, even a bare Flutter TextField(obscureText: true)
requires two taps to bring up the IME on first interaction. This is
a Flutter Engine + vendor IME compatibility issue and cannot be
worked around in Dart-layer component code.
🤔 这个 PR 的性质是?
🔗 相关 Issue
💡 需求背景和解决方案
📝 更新日志
fix(组件名称): 处理问题或特性描述 ...
本条 PR 不需要纳入 Changelog
☑️ 请求合并前的自查清单
组件类名: 修改描述(示例:TBottomTabBar: 修复iconText模式,底部溢出2.5像素)