Allow default behaviour in stopEvent/ignoreMutation overrides#5590
Allow default behaviour in stopEvent/ignoreMutation overrides#5590alexkuz wants to merge 1 commit intoueberdosis:nextfrom
Conversation
🦋 Changeset detectedLatest commit: 723813b The changes in this PR will be included in the next version bump. This PR includes no changesetsWhen changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
❌ Deploy Preview for tiptap-embed failed. Why did it fail? →
|
packages/core/src/NodeView.ts
Outdated
|
|
||
| if (typeof this.options.stopEvent === 'function') { | ||
| return this.options.stopEvent({ event }) | ||
| const shouldStopEvent = return this.options.stopEvent({ event }) |
There was a problem hiding this comment.
This syntax looks wrong
There was a problem hiding this comment.
oh, I just saw this. Editing PR directly on Github was a mistake 😅
✅ Deploy Preview for tiptap-embed ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
@alexkuz could you take a look at those linting issues? |
|
@bdbch all fixed |
|
Sorry - one more thing. Could you rebase this PR into next so we can cherry-pick it down to main/develop? We don't use develop for active dev anymore. |
|
Done! |
|
@alexkuz could you rebase this to the current develop branch as we released V3, deprecating the next branch & would need to update most of our PR's anyway? Thanks a lot! I will look into getting this merged afterwards! |
Changes Overview
In my case, I needed to override
stopEvent, but only for a specific case. Otherwise I'd like for it to have a default behaviour. To do this, I'd have to recreate all the checks from defaultstopEventin my override. This PR addresses this inconvenience.Implementation Approach
stopEventignores override only if you explicitly return anull. This should minimize a breaking change for existing usages.Testing Done
Verification Steps
Additional Notes
Checklist
Related Issues
#257