|
|
@@ -1,6 +1,7 @@
|
|
|
<script lang="ts">
|
|
|
import { getDeletionInfo } from '$lib/stores/chat.svelte';
|
|
|
import { copyToClipboard } from '$lib/utils/copy';
|
|
|
+ import { isIMEComposing } from '$lib/utils/is-ime-composing';
|
|
|
import ChatMessageAssistant from './ChatMessageAssistant.svelte';
|
|
|
import ChatMessageUser from './ChatMessageUser.svelte';
|
|
|
|
|
|
@@ -93,7 +94,9 @@
|
|
|
}
|
|
|
|
|
|
function handleEditKeydown(event: KeyboardEvent) {
|
|
|
- if (event.key === 'Enter' && !event.shiftKey) {
|
|
|
+ // Check for IME composition using isComposing property and keyCode 229 (specifically for IME composition on Safari)
|
|
|
+ // This prevents saving edit when confirming IME word selection (e.g., Japanese/Chinese input)
|
|
|
+ if (event.key === 'Enter' && !event.shiftKey && !isIMEComposing(event)) {
|
|
|
event.preventDefault();
|
|
|
handleSaveEdit();
|
|
|
} else if (event.key === 'Escape') {
|