fix: Prevent default action when clicking the postpone button #2513
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
When clicking the "postpone" button (a feature introduced in version 5.3.0), then the default behavior of the associated click event should be suppressed.
Motivation and Context
If the task query appears in a callout, then clicking the postpone button will also trigger opening the callout for editing. This default behavior appears in addition to the desired behavior of postponing the task and is not expected to happen.
Moreover, when right-clicking the button, in addition to the postpone-context-menu, the default context menu for editing the callout will also appear on top of it. This PR fixes this problem as well. The default menu now only appears when right-clicking the callout outside of the postpone button.
Fixes #2512
How has this been tested?
Types of changes
Changes visible to users:
fix
- non-breaking change which fixes an issue)feat
- non-breaking change which adds functionality)feat!!
orfix!!
- fix or feature that would cause existing functionality to not work as expected)docs
- improvements to any documentation content for users)vault
- improvements to the Tasks-Demo sample vault)contrib
- any improvements to documentation content for contributors - see Contributing to Tasks)Internal changes:
refactor
- non-breaking change which only improves the design or structure of existing code, and making no changes to its external behaviour)test
- additions and improvements to unit tests and the smoke tests)chore
- examples include GitHub Actions, issue templates)Checklist
yarn run lint
.Terms