filamentphp / filament

A collection of beautiful full-stack components for Laravel. The perfect starting point for your next app. Using Livewire, Alpine.js and Tailwind CSS.
https://filamentphp.com
MIT License
16.13k stars 2.57k forks source link

Markdown editor sometimes not save the data #13385

Closed rubenrcdev closed 1 week ago

rubenrcdev commented 3 weeks ago

Package

filament/forms

Package Version

v3.2.92

Laravel Version

v11.11.1

Livewire Version

v3.5.1

PHP Version

PHP 8.3.8

Problem description

Hi,

https://github.com/filamentphp/filament/assets/120738508/47c6f253-8648-4f35-8360-124240126748

When you update a resource with the Markdown Editor, sometimes the new data is not saved. I tried to find the problem before send the bug report, for trying to elucidate the reason why it occurs. But not was possible. I only detected, that when the resource is not saved, the ajax requests, not have the "updated" field filled about the current form state. Is like, it dont detect the changes in the form state.

I let you a video about the bug, and i let you a demo repo, is a very basic filament panel, so, is not a bug in a complex system, it occurs even in an panel with a one resource, one model and two fields in a model.

Thank you for all.

Expected behavior

Save the data all the times.

Steps to reproduce

Enter o reload resource page, and try to save multiple times the form, sometimes is saved, other times not.

Reproduction repository (issue will be closed if this is not valid)

https://github.com/rubenrcdev/filament-editor-bug

Relevant log output

No response

Donate 💰 to fund this issue

Fund with Polar

rubenrcdev commented 1 week ago

I think is related with the issue #12858

rubenrcdev commented 1 week ago

I did more testing to find what happens in the markdown editor.

I modified public/js/filament/forms/components/markdown-editor.js file, to include a console.log as can see in the next screenshoot:

image

When i write something, the watch state takes some time to refresh data, it takes about 1 second to refresh, if i save before that happens, the data is not updated.

The bug is not from filament, is about how works livewire. So, i close the issue.

Thanks, and regards.