dasmikko / strapi-tiptap-editor

A drop-in replacement for the strapi editor
MIT License
64 stars 29 forks source link

Editor is not detecting changes when typing #61

Closed mariojsnunes closed 1 year ago

mariojsnunes commented 1 year ago

versions: "@strapi/strapi": "4.6.1", "strapi-tiptap-editor": "^0.9.10"

When I type on the editor, the save button stays grey (no changes). If I also change another field, the save button is enabled, but when I click save, the editor text is not saved.

My guess is that it's not updating the model. I can force it to detect changes by selecting text and clicking clicking on the buttons (bold, italic, etc)

aw-gerrit commented 1 year ago

same here

thevisualfox commented 1 year ago

Yup, same here!

dasmikko commented 1 year ago

I'm having some trouble replicating this issue. Can you make a project that has this issue?

Taylor-Hinote commented 1 year ago

Same problem here but I found a work around

While typing or editing all functions act normal but won't allow you to save changes, I hit the center align button after highlighting some basic content I then can set that content back to what ever I had it previous and then saving works fines

tiptapBug

mastepanoski commented 1 year ago

The same issue happens when an image is inserted. The editor does not detect the change.

VercammenJens commented 1 year ago

Same issue here and can't really downgrade to a previous package because the strapi build always fails then.

VercammenJens commented 1 year ago

@dasmikko Been investigating a little bit by cloning the package and testing local. Haven't tried replicating the issue yet. What I've currently found is that on every update/change there is a error in the console. (possibly a dependency issue?)

I've tried logging the ctx & settings inside the onUpdate function in Wysiywg/index.js but this code is never reached.

    onUpdate(ctx) {
      console.log(settings)
      console.log(ctx)
      if (settings.other.saveJson) {
        onChange({target: {name, value: JSON.stringify(ctx.editor.getJSON())}})
      } else {
        onChange({target: {name, value: ctx.editor.getHTML()}})
      }
    },

It's my first time kind of trying to contributing to an open source package, so I'm not really sure how to debug it other than adding logs here and there. Tips are always welcome!

All this happens on version 0.9.10 & 0.9.11 of strapi-tiptap-editor and strapi version 4.7.1, but I guess the strapi version isn't a big impact on this. I'll also add an image of the minified error message:

Screenshot 2023-03-16 at 15 56 16
xbeakmanx commented 1 year ago

same here

marcinsz84 commented 1 year ago

Same here on "@strapi/strapi": "4.8.2" and "strapi-tiptap-editor": "^0.9.11"

dasmikko commented 1 year ago

Try the latest version and add

config.plugins.push(new webpack.NormalModuleReplacementPlugin(
  /^tippy\.js$/,
  'tippy.js/dist/tippy-bundle.umd.min.js'
))

To your /src/admin/webpack.config.js.

I works in my local test environment.

marcinsz84 commented 1 year ago

@dasmikko Works well, thanks.