mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-05 22:38:48 +00:00
fix: Added onKeyDown function for input field (#6699)
* Added onKeyDown function for input field * Updated CreateOrganization.jsx
This commit is contained in:
parent
6308f4292c
commit
6e249bc540
1 changed files with 8 additions and 0 deletions
|
|
@ -35,6 +35,13 @@ export const CreateOrganization = ({ showCreateOrg, setShowCreateOrg }) => {
|
|||
}
|
||||
};
|
||||
|
||||
const handleKeyDown = (e) => {
|
||||
if (e.keyCode === 13) {
|
||||
e.preventDefault();
|
||||
createOrganization();
|
||||
}
|
||||
};
|
||||
|
||||
const handleInputChange = (e) => {
|
||||
const value = e.target.value;
|
||||
setErrorText('');
|
||||
|
|
@ -62,6 +69,7 @@ export const CreateOrganization = ({ showCreateOrg, setShowCreateOrg }) => {
|
|||
<input
|
||||
type="text"
|
||||
onChange={handleInputChange}
|
||||
onKeyDown={handleKeyDown}
|
||||
className="form-control"
|
||||
placeholder={t('header.organization.workspaceName', 'workspace name')}
|
||||
disabled={isCreating}
|
||||
|
|
|
|||
Loading…
Reference in a new issue