Giter Site home page Giter Site logo

Comments (8)

sibiraj-s avatar sibiraj-s commented on June 14, 2024

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.

Benny739 avatar Benny739 commented on June 14, 2024

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.

sibiraj-s avatar sibiraj-s commented on June 14, 2024

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.

sibiraj-s avatar sibiraj-s commented on June 14, 2024

And need to verify the OnPush changedetection strategy as well.

from ngx-tiptap.

sibiraj-s avatar sibiraj-s commented on June 14, 2024

Note: Moving from transaction to update event might fix #24

from ngx-tiptap.

Benny739 avatar Benny739 commented on June 14, 2024

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.

sibiraj-s avatar sibiraj-s commented on June 14, 2024

Fixed in v7.0.0

from ngx-tiptap.

github-actions avatar github-actions commented on June 14, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.