mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-20 07:00:09 +08:00
fix: check isComposing on keydown (#5848)
This commit is contained in:
parent
138ab1c5b7
commit
2193a665c6
@ -267,11 +267,7 @@ const PopupContainer: React.FC<Props> = ({ model, resolve }) => {
|
|||||||
// 处理键盘导航
|
// 处理键盘导航
|
||||||
const handleKeyDown = useCallback(
|
const handleKeyDown = useCallback(
|
||||||
(e: KeyboardEvent) => {
|
(e: KeyboardEvent) => {
|
||||||
if (!open) return
|
if (!open || modelItems.length === 0 || e.isComposing) return
|
||||||
|
|
||||||
if (modelItems.length === 0) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// 键盘操作时禁用鼠标 hover
|
// 键盘操作时禁用鼠标 hover
|
||||||
if (['ArrowUp', 'ArrowDown', 'PageUp', 'PageDown', 'Enter', 'Escape'].includes(e.key)) {
|
if (['ArrowUp', 'ArrowDown', 'PageUp', 'PageDown', 'Enter', 'Escape'].includes(e.key)) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user