mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-06 06:48:21 +00:00
Fixes issues with release modal *close , autofocus , keyboard actions (#2032)
This commit is contained in:
parent
8f2ab3f269
commit
0cbfcf9a2d
1 changed files with 16 additions and 2 deletions
|
|
@ -54,7 +54,7 @@ export const AppVersionsManager = function AppVersionsManager({
|
|||
appVersionService
|
||||
.create(appId, versionName, createAppVersionFrom.id)
|
||||
.then(() => {
|
||||
setShowModal(false);
|
||||
closeModal();
|
||||
toast.success('Version Created');
|
||||
|
||||
appVersionService.getAll(appId).then((data) => {
|
||||
|
|
@ -148,8 +148,20 @@ const CreateVersionModal = function CreateVersionModal({
|
|||
appVersions,
|
||||
showCreateVersionModalPrompt,
|
||||
}) {
|
||||
const handleKeyPress = (event) => {
|
||||
if (event.key === 'Enter') {
|
||||
// eslint-disable-next-line no-undef
|
||||
createVersion(versionName, createAppVersionFrom);
|
||||
}
|
||||
};
|
||||
return (
|
||||
<Modal show={showModal || showCreateVersionModalPrompt} setShow={setShowModal} title="Create Version">
|
||||
<Modal
|
||||
show={showModal || showCreateVersionModalPrompt}
|
||||
setShow={setShowModal}
|
||||
title="Create Version"
|
||||
autoFocus={false}
|
||||
closeModal={() => setShowModal(false)}
|
||||
>
|
||||
<div className="mb-3">
|
||||
<div className="col">
|
||||
<label className="form-label">Version Name</label>
|
||||
|
|
@ -160,6 +172,8 @@ const CreateVersionModal = function CreateVersionModal({
|
|||
placeholder="Enter version name"
|
||||
disabled={isCreatingVersion}
|
||||
value={versionName}
|
||||
autoFocus={true}
|
||||
onKeyPress={(e) => handleKeyPress(e)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in a new issue