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

Comments

tresti88 created an issue. See original summary.

tresti88’s picture

tresti88’s picture

Status: Active » Needs review
recrit’s picture

@tresti88 Thanks, the patch makes sense to me. I've ran into this on other AJAX form callback.

  • recrit committed c4fe887 on 8.x-1.x authored by tresti88
    Issue #3128259 by tresti88: call rebuild on the form_state with every...
recrit’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.