mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-27 04:31:27 +08:00
fix(hooks): prevent save on composing enter key in useInPlaceEdit (#10972)
(cherry picked from commit f5a1d3f8d0)
This commit is contained in:
parent
36b67c6917
commit
261cfab2f0
@ -70,7 +70,7 @@ export function useInPlaceEdit(options: UseInPlaceEditOptions): UseInPlaceEditRe
|
||||
|
||||
const handleKeyDown = useCallback(
|
||||
(e: React.KeyboardEvent) => {
|
||||
if (e.key === 'Enter') {
|
||||
if (e.key === 'Enter' && !e.nativeEvent.isComposing) {
|
||||
e.preventDefault()
|
||||
saveEdit()
|
||||
} else if (e.key === 'Escape') {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user