Commit 6dae2ee
committed
fix: set focus to search edit when launcher becomes visible
When the launcher is shown, the keyboard focus remains on the root
InputEventItem instead of the search edit. This causes two issues:
1. The cursor does not appear in the search bar on each open.
2. The IME candidate window is not visible during the preedit phase
(e.g. typing pinyin), because InputEventItem is not a text input
widget and cannot provide cursor geometry for IME positioning.
Fix by calling forceActiveFocus() on the search edit when the launcher
becomes visible, for both windowed and fullscreen modes.
修复启动器显示时搜索框未获得焦点的问题。启动器打开时键盘焦点停留在根节点
InputEventItem 上而非搜索框,导致光标不在搜索栏,且中文输入法预编辑阶段
(如拼音输入时)候选框不可见。在启动器可见时对搜索框调用 forceActiveFocus()
以修复此问题,同时修复窗口模式和全屏模式。
PMS: BUG-3017431 parent c39aac4 commit 6dae2ee
2 files changed
Lines changed: 10 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
883 | 883 | | |
884 | 884 | | |
885 | 885 | | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
886 | 891 | | |
887 | | - | |
888 | 892 | | |
889 | 893 | | |
890 | 894 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
303 | 303 | | |
304 | 304 | | |
305 | 305 | | |
306 | | - | |
307 | | - | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
308 | 310 | | |
| 311 | + | |
309 | 312 | | |
310 | 313 | | |
311 | 314 | | |
| |||
0 commit comments