mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
fix: negate check while trying to discard (#4653)
This commit is contained in:
parent
87de913c76
commit
4d9cd0c318
@ -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!",
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user