Really nice module this, makes editors' jobs easier knowing what a paragraph will look like before saving content, which i think is important.
One thing I found was that if i edited a value on a paragraph (once i already created it), the preview wouldn't show the updated field values unless you select one of the paragraph actions like `add another paragraph` or `collapse` etc.
I found that in `submitPreviewerItem` in `ParagraphsPreviewerWidgetTrait` it was checking that if the form was not cached and then it would call $form_state->rebuild() .
Can we remove this check and just call setRebuild each time someone selects the preview link? I don't think there will be much of a performance loss from doing this and it means that when values are altered, the preview option will be able to reflect updated values straight away.
I will attach a patch.
Let me know your thoughts
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | call-rebuild-on-the-form_state-with-every-preview-click-3128259-2.patch | 620 bytes | tresti88 |
Comments
Comment #2
tresti88Comment #3
tresti88Comment #4
recrit commented@tresti88 Thanks, the patch makes sense to me. I've ran into this on other AJAX form callback.
Comment #6
recrit commented