diff --git a/memento-note/components/contextual-ai-chat.tsx b/memento-note/components/contextual-ai-chat.tsx index 580609f..44dcf1f 100644 --- a/memento-note/components/contextual-ai-chat.tsx +++ b/memento-note/components/contextual-ai-chat.tsx @@ -841,7 +841,7 @@ export function ContextualAIChat({ ))} @@ -849,8 +849,8 @@ export function ContextualAIChat({ className="text-xs px-3 py-1.5 rounded-lg border border-border bg-card outline-none focus:border-primary w-full" placeholder={t('ai.action.customLang') || 'Autre langue...'} value={customLangInput} - onChange={e => setCustomLangInput(e.target.value)} - onKeyDown={e => { if (e.key === 'Enter' && customLangInput.trim()) { setTranslateTarget(customLangInput.trim()); setCustomLangInput('') } }} + onChange={e => { const val = e.target.value; setCustomLangInput(val); setTranslateTarget(val); }} + onKeyDown={e => { if (e.key === 'Enter' && translateTarget.trim()) { handleAction(action, translateTarget.trim()); } }} />