awcodes / filament-tiptap-editor

A Rich Text Editor plugin for Filament Forms.
MIT License
261 stars 71 forks source link

When using tiptap editor in filament Builder encountering an error when removing an element and saving #250

Closed RobertsG closed 8 months ago

RobertsG commented 8 months ago

Filament Version

v3.1.1

Plugin Version

v3.2.7

PHP Version

PHP 8.1

Problem description

When editing a record that has a builder or a repeatable that contains the tiptap editor, encountering an error when trying to save or do something with the form after removing the tiptap element builder block (the document previously has to be saved with the builder element).

Do not encounter this error on v3.2.0, but appeared since updating to v3.2.7.

Example of document with the builder containing the editor: image

Example with the block removed image

Example of the error after clicking save image

Expected behavior

Not to encounter an error, after removing a tiptap builder block.

Steps to reproduce

  1. Create a resource that contains a builder that contains a tiptap editor.
  2. Create a record with the single builder element
  3. Save the record
  4. Open the record again
  5. Remove the builder block that contains the tiptap editor
  6. Try to add a new builder block or try to save the document.
  7. Should encounter an error.

Reproduction repository

No response

Relevant log output

No response

awcodes commented 8 months ago

Can you update to Filament v3.1.18 and see if you still have the issue?

type is part of the Builder component and not the plugin. Could still be an issue with the plugin but need to make sure it's not an issue with core.

digitalsimon commented 8 months ago

I have the same issue with Filament v3.1.18 and Plugin version v3.2.7.

RobertsG commented 8 months ago

@awcodes will try the filament update tomorrow, although don't see how that will affect things, since I started encountering the error after updating tiptap.

RobertsG commented 8 months ago

Tried updating to the latest version, still encountering the issue.

awcodes commented 8 months ago

Thank you for checking, just wanted to make sure. Weird that the field would break the parent component though. I'll look into it.

awcodes commented 8 months ago

Can you make a reproduction repo for me?

It's working fine in the builder in my test app.

Screenshot 2023-12-13 at 9 47 52 AM

awcodes commented 8 months ago

I'm not sure if it fixes your issue as there's still a bug with alpine and nested entangled state. So I'll leave this open for now, but if the later release fixes the issue please close or let me know.

Thank you for your patience..

RobertsG commented 8 months ago

Updated today and the issue seems to be resolved. Thanks.