Request: Expose ignoreMutation option in Node Views #1538
Labels
sponsor 💖
This issue or pull request was created by a Tiptap sponsor
Type: Feature
The issue or pullrequest is a new feature
The problem I am facing
We're facing issues with nesting one Tiptap editor inside of a nodeview in another Tiptap editor. The problem is that when typing in the inner editor, we trigger selection changes on the parent editor. This leads to unnecessary rerenders on the parent views.
Marijn's suggestion was to use ignoreMutation in the nodeView config to block these selection changes.
Right now in NodeView.ts, all selections are being sent through:
The solution I would like
The option to send a custom
ignoreMutation
in Node Views, just like we can send a customstopEvent
.I believe the change would be as simple as:
And the ability to pass ignoreMutation in
ReactNodeViewRendererOptions
.Alternatives I have considered
We're currently hacking this by using a custom stopEvent and passing
view.domObserver.suppressSelectionUpdates()
, which seems to run before the mutation observer triggers. But this API is undocumented so we'd prefer to use Marijn's recommended approach.The text was updated successfully, but these errors were encountered: