mohamedsabil83 / filament-forms-tinyeditor

A TinyMce Editor component for filament
MIT License
164 stars 37 forks source link

[Bug]: Not properly load with spatie-laravel-translatable-plugin after cople changing languges #92

Closed vovacorgo closed 9 months ago

vovacorgo commented 10 months ago

What happened?

Not properly load with spatie-laravel-translatable-plugin after cople changing languges

How to reproduce the bug

изображение when i change language first time works properply, after changing again get empty field: изображение and that in console изображение

Package Version

2

PHP Version

8.2

Laravel Version

10

Which operating systems does with happen with?

No response

Notes

No response

mohamedsabil83 commented 10 months ago

Yeah, I notice that, but I wonder if that's because of something related to Filament or Livewire. I'll dig it, and PR is also welcome.

ysfkaya commented 9 months ago

I'm having the same problem. Any progress?

mohamedsabil83 commented 9 months ago

Sorry, I'm swamped this period. I'll try to work on it soon. Also, I noted some developers discussing different issues related to the translatable plugin. As V3 is still new, it'll take time to be stable.

mohamedsabil83 commented 9 months ago

I just tagged v2.0.3. Can you check?

ysfkaya commented 9 months ago

The situation is the same. On the other hand, I will try to solve it. If so, I will let you know.

mohamedsabil83 commented 9 months ago

Sounds good. I'll close it for now, and you can re-open it if you find something. btw, I tried it on my side, and it works. Try to check if you publish assets or if something conflicts with them.

ysfkaya commented 9 months ago

I think I found the reason for the error. The editor is removing after each component updated and trying to re-init.

tiny-editor.js

  Livewire.hook('morph.updated', (el) => {
      if (!window.tinySettingsCopy) {
          return;
      }

      const isModalOpen = document.body.classList.contains('tox-dialog__disable-scroll');

      if (!isModalOpen && sortableClass.some(i => el.el.classList.contains(i))) {
          removeEditors();
          setTimeout(reinitializeEditors, 1);
      }
  })

So when I removed the above code it's works well. But this time It does not work when change the order of the element in the sortable container.