Comments (8)
To be frank, I don't remember why I made the change. Also, I don't remember seeing an update event. At that time most of their docs were in progress. Or I could not have noticed/missed.
I am open to making this change. But, unless we properly evaluate the difference between the two events. I think it is worth considering it as a breaking change. Thoughts?
from ngx-tiptap.
Yeah we could consider it a breaking change.
According to the tiptap docs update is the proper event here.
I tested it and I could not see any difference. On transaction just emits way more often but when it comes to the content change there was no difference.
I think we could go with a minor version and mention the change in the behavior.
Should I create a PR?
from ngx-tiptap.
And I think I remember the reason for using the transaction event. There are certain commands where update events are not triggered. But I think there is a workaround, all commands of this category we need to add an extra boolean parameter to manually tell tiptap to fire the event.
Example:
Before
editor.commands.setContent(‘Hello World!')
After
editor.commands.setContent(‘Hello World!’, true)
Ref: https://tiptap.dev/api/commands/set-content
from ngx-tiptap.
And need to verify the OnPush
changedetection strategy as well.
from ngx-tiptap.
Note: Moving from transaction to update event might fix #24
from ngx-tiptap.
Yes the emitUpdate option is actually important, because #24 arises from onTransaction not respecting the emitUpdate
this.editor.chain().setContent(value, false).run();
We already have emitUpdate = false in writeValue, so it shouldn't trigger an update, but only on('update') respects that option.
OnPush is no problem here, because handleChange isn't changing. The only difference the on('update') should do, is not emit a value in the writeValue function.
from ngx-tiptap.
Fixed in v7.0.0
from ngx-tiptap.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in the thread.
from ngx-tiptap.
Related Issues (20)
- Two-way binding (current value is not displayed) HOT 7
- You can't no longer add nodes to the editor, if it's provided from a service HOT 4
- No content displayed when it is JSON HOT 6
- Help wanted: Help with creating a menu
- ngModelChange gets emitted initially, without actual value change HOT 7
- TypeError: Cannot read property 'matchesNode' of null HOT 3
- Angular 15 Support HOT 7
- Update to angular v16 HOT 2
- Components not rendering inside the editor HOT 5
- Cannot reconcile build once Tiptap extensions are added HOT 4
- Docs Improvement: Suggest ::ng-deep instead of ViewEncapsulation HOT 5
- [Question] slash command HOT 3
- How to solve 'Duplicate use of selection JSON ID cell'? HOT 2
- Example of using with suggestion plugin
- applicationRef.injector vs hierarchical injector in AngularRenderer HOT 10
- Property '"editor"' is incompatible with index signature HOT 1
- HTMLAttributes not getting attached to angular component
- Editor selected node doesn't update with onPush change detection. HOT 2
- Problem with compilation when running Angular v17 SSR HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ngx-tiptap.