Skip to content

Commit

Permalink
feat: clear document forms after submit
Browse files Browse the repository at this point in the history
  • Loading branch information
HadiKhai committed Jul 22, 2021
1 parent a29197b commit fca3605
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/components/main/NewItemModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ const NewItemModal = ({ open, handleClose }) => {

setConfirmButtonDisabled(true);
postItem({ parentId, ...updatedPropertiesPerType[selectedItemType] });
setUpdatedPropertiesPerType({
...updatedPropertiesPerType,
[selectedItemType]: {},
});
// schedule button disable state reset AFTER end of click event handling
setTimeout(() => setConfirmButtonDisabled(false), DOUBLE_CLICK_DELAY_MS);
return handleClose();
Expand Down

0 comments on commit fca3605

Please sign in to comment.