π₯π₯π₯ Open-source Jira, Linear, Monday, and ClickUp alternative. Plane is a modern project management platform to manage tasks, sprints, docs, and triage.
TypeScript boardsbug-trackerdjangodockerganttissue-trackerjirajira-alternativekanbanlinearpostgresqlproduct-managementproject-managementproject-planningpythonreactredistypesciptvitework-management
fix: negate check while trying to discard (#4653)
M. Palanikannan4d9cd0c3182e
diff --git a/web/components/inbox/modals/create-edit-modal/create-root.tsx b/web/components/inbox/modals/create-edit-modal/create-root.tsxindex 08743f63c1..36f1b0abe5 100644--- a/web/components/inbox/modals/create-edit-modal/create-root.tsx+++ b/web/components/inbox/modals/create-edit-modal/create-root.tsx@@ -81,7 +81,7 @@ export const InboxIssueCreateRoot: FC<TInboxIssueCreateRoot> = observer((props)const handleFormSubmit = async (event: FormEvent<HTMLFormElement>) => {event.preventDefault();- if (descriptionEditorRef.current?.isEditorReadyToDiscard()) {+ if (!descriptionEditorRef.current?.isEditorReadyToDiscard()) {setToast({type: TOAST_TYPE.ERROR,title: "Error!",diff --git a/web/components/issues/issue-modal/form.tsx b/web/components/issues/issue-modal/form.tsxindex 1d91e687e9..9313f8f77f 100644--- a/web/components/issues/issue-modal/form.tsx+++ b/web/components/issues/issue-modal/form.tsx@@ -122,7 +122,7 @@ export const IssueFormRoot: FC<IssueFormProps> = observer((props) => {const { getProjectById } = useProject();const { areEstimatesEnabledForProject } = useEstimate();- function handleKeyDown(event: KeyboardEvent) {+ const handleKeyDown = (event: KeyboardEvent) => {if (editorRef.current?.isEditorReadyToDiscard()) {onClose();} else {@@ -133,7 +133,7 @@ export const IssueFormRoot: FC<IssueFormProps> = observer((props) => {});event.preventDefault(); // Prevent default action if editor is not ready to discard}- }+ };useKeypress("Escape", handleKeyDown);