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