Skip to content

Commit

Permalink
fix: if the content of a task is only spaces, it gets deleted as if i… (
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelromcar-parabol authored Jul 15, 2024
1 parent 0cff6dc commit 59eb73f
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ const OutcomeCardContainer = memo((props: Props) => {
const editorEl = editorRef.current
if (!editorEl || editorEl.type !== 'textarea') return
const {value} = editorEl
if (!value && !isFocused) {
if (!value.trim() && !isFocused) {
DeleteTaskMutation(atmosphere, {taskId})
} else {
const initialContentState = editorState.getCurrentContent()
Expand All @@ -100,7 +100,7 @@ const OutcomeCardContainer = memo((props: Props) => {
return
}
const nextContentState = editorState.getCurrentContent()
const hasText = nextContentState.hasText()
const hasText = nextContentState.getPlainText().trim().length > 0
if (!hasText && !isFocused) {
DeleteTaskMutation(atmosphere, {taskId})
} else {
Expand Down

0 comments on commit 59eb73f

Please sign in to comment.