Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editor state not reset when nested #385

Open
freshleafmedia opened this issue May 9, 2024 · 1 comment
Open

Editor state not reset when nested #385

freshleafmedia opened this issue May 9, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@freshleafmedia
Copy link

Filament Version

v3.2.76

Plugin Version

v3.3.3

PHP Version

8.3.6

Problem description

When the schema of a block contains a TiptapEditor the editor state is not reset when adding a second block.

I appreciate that nested editors isn't necessarily an intended feature however it allows for some very dynamic customisation, any pointers on how to fix the issue or where the issue is coming from would be appreciated.

Expected behavior

The editor value should be blank

Steps to reproduce

repro-2024-05-09_11.55.17.mp4

Reproduction repository

https://github.com/freshleafmedia/tiptap-repro

Relevant log output

No response

@freshleafmedia freshleafmedia added the bug Something isn't working label May 9, 2024
@freshleafmedia
Copy link
Author

I think I have narrowed it down. The TiptapEditors in each block are assigned the same statePath. It's effectively like doing:

$schema = [
    TiptapEditor::make('nested-content'),
    TiptapEditor::make('nested-content'),
];

So obviously they have the same state.

🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant