I tested some functionality in paragraphs and found some edge case when you have paragraphs with required fields empty and you press "Collapse all". Then "Collapse all" changes state to "Edit all" even if everything is still expanded.

I have attached gif with an example.

Demo

CommentFileSizeAuthor
para_collapse_all.gif318.7 KBmtodor
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mtodor created an issue. See original summary.

miro_dietiker’s picture

Yeah party... ;-)

That's strange. The idea was that a failing validation basically consistencly force expands the Paragraph widget / child. So instead of just displaying the widget / child expanded even if it has "collapsed" state, the validation should set that state back to edit.

It seems that's a bug in validation result affects state consistency.

miro_dietiker’s picture

Aaaaand sorry to mention, but tests will be a requirement for these problems. :-)

miro_dietiker’s picture

Berdir’s picture

Status: Active » Closed (duplicate)

The reason it behaves like this is because of the auto-uncollapse feature that we currently have that automatically uncollapses paragraphs with validation errors.

The all button doesn't update because we used to build that first. Now we build it last which fixes other problems and also this, now the button knows that they are still uncollapsed.

But we identified the closed-paragraph-validation-feature as a huge performance problem in #2935134: [meta] Improve performance of paragraphs widget and are basically removing it there. Instead, we fixed validation of the collapse button so you instead now get a validation message that tells you *why* you're not allowed to collapse :)

Closing as duplicate.