Yoopta-Editor icon indicating copy to clipboard operation
Yoopta-Editor copied to clipboard

[BUG] Fix solution for document change detection in YooptaEditor

Open Oyoha opened this issue 1 year ago • 0 comments

Has this bug been raised before?

  • [X] I have checked "open" AND "closed" issues and this is not a duplicate

Description

You have to compare objects to understand that something has changed. Plus, when adding a new block at the end of the document (when the mouse is clicked), the presence of changes is triggered, since a new block appears (and before we started entering text). const onEditorChange = (payload: any) => { if (originalEditorValue !== undefined) { setIsChanged(!_.isEqual(originalEditorValue, payload)) } }

Steps to Reproduce

If you know the steps, follow the below format and provide steps to reproduce

For example:

  1. Go to page.
  2. On top right side, close to the <Account> menu
  3. Some menu are not working properly.
  4. Continue...

If you don't know exact steps, include any relevant details like:

  • What page you were on...
  • What you were trying to do...
  • What went wrong...

Environment

  • OS:
  • Browser:

Screenshots

No response

Do you want to work on this issue?

No

If "yes" to above, please explain how you would technically implement this

No response

Oyoha avatar Aug 09 '24 08:08 Oyoha