mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-26 00:46:52 +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:
@ -22,6 +22,12 @@ const CreateAgentModal = ({ visible, hideModal, loading, onOk }: IProps) => {
|
||||
return onOk(ret.name);
|
||||
};
|
||||
|
||||
const handleKeyDown = (e: React.KeyboardEvent) => {
|
||||
if (e.key === 'Enter' && !e.shiftKey) {
|
||||
handleOk();
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<Modal
|
||||
title={t('createGraph', { keyPrefix: 'flow' })}
|
||||
@ -44,7 +50,7 @@ const CreateAgentModal = ({ visible, hideModal, loading, onOk }: IProps) => {
|
||||
name="name"
|
||||
rules={[{ required: true, message: t('namePlaceholder') }]}
|
||||
>
|
||||
<Input />
|
||||
<Input onKeyDown={handleKeyDown} />
|
||||
</Form.Item>
|
||||
</Form>
|
||||
</Modal>
|
||||
|
||||
Reference in New Issue
Block a user