mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-23 06:46:40 +08:00
Fix: Creating Knowledge Base Support Enter Key (#7258)
### What problem does this PR solve? [https://github.com/infiniflow/ragflow/issues/7180](https://github.com/infiniflow/ragflow/issues/7180) When creating a knowledge base, support the enter key ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
@ -142,6 +142,18 @@ const ChatConfigurationModal = ({
|
||||
}
|
||||
}, [initialDialog, form, visible, modelId]);
|
||||
|
||||
const handleKeyDown = (e: React.KeyboardEvent) => {
|
||||
// Allow Enter in textareas
|
||||
if (e.target instanceof HTMLTextAreaElement) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (e.key === 'Enter' && !e.shiftKey) {
|
||||
e.preventDefault();
|
||||
handleOk();
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<Modal
|
||||
title={title}
|
||||
@ -171,6 +183,7 @@ const ChatConfigurationModal = ({
|
||||
style={{ maxWidth: 600 }}
|
||||
validateMessages={validateMessages}
|
||||
colon={false}
|
||||
onKeyDown={handleKeyDown}
|
||||
>
|
||||
{Object.entries(segmentedMap).map(([key, Element]) => (
|
||||
<Element
|
||||
|
||||
Reference in New Issue
Block a user