Commit 9f4214a
committed
fix: enforce baseLayer focus when launcher becomes visible
To address the low-probability issue where the launcher loses keyboard
focus upon opening (preventing direct text input), this commit explicitly
calls forceActiveFocus() on the baseLayer (InputEventItem) when
LauncherController.visible becomes true.
Unlike previous attempts that focused the searchEdit directly (which
violated the design requirement of not activating the search bar
visually upon open), this approach ensures the root item safely
receives key events and forwards them to the search edit without
triggering unwanted visual states.
修复启动器以极低概率打开时丢失键盘焦点(无法直接输入文本)的问题。
在启动器显示(LauncherController.visible 为 true)时,显式调用
baseLayer (InputEventItem) 的 forceActiveFocus() 强制获取活跃焦点。
与之前直接聚焦 searchEdit 的尝试(违背了打开时不直接激活搜索框
的设计要求)不同,此方法确保根节点能安全地接收按键事件并将其转发
给搜索框,同时不会触发不需要的视觉激活状态。
PMS: BUG-3017431 parent c5982f0 commit 9f4214a
2 files changed
Lines changed: 14 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
887 | 887 | | |
888 | 888 | | |
889 | 889 | | |
890 | | - | |
891 | | - | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
892 | 897 | | |
893 | 898 | | |
894 | 899 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
305 | 305 | | |
306 | 306 | | |
307 | 307 | | |
308 | | - | |
309 | | - | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
310 | 315 | | |
311 | 316 | | |
312 | 317 | | |
| |||
0 commit comments