mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-25 16:26:51 +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:
@ -23,10 +23,15 @@ const KnowledgeCreatingModal = ({
|
||||
|
||||
const handleOk = async () => {
|
||||
const ret = await form.validateFields();
|
||||
|
||||
onOk(ret.name);
|
||||
};
|
||||
|
||||
const handleKeyDown = async (e) => {
|
||||
if (e.key === 'Enter') {
|
||||
await handleOk();
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<Modal
|
||||
title={t('createKnowledgeBase')}
|
||||
@ -48,7 +53,7 @@ const KnowledgeCreatingModal = ({
|
||||
name="name"
|
||||
rules={[{ required: true, message: t('namePlaceholder') }]}
|
||||
>
|
||||
<Input placeholder={t('namePlaceholder')} />
|
||||
<Input placeholder={t('namePlaceholder')} onKeyDown={handleKeyDown} />
|
||||
</Form.Item>
|
||||
</Form>
|
||||
</Modal>
|
||||
|
||||
Reference in New Issue
Block a user