Respect widget collapsed property unless nested field validation fails

Created on 8 June 2022, almost 3 years ago
Updated 13 May 2023, almost 2 years ago

Problem/Motivation

When using the InlineEntityFormSimple or InlineEntityFormComplex widget, site administrators can determine whether the details item that contains the IEF widget is collapsed or expanded by default.

This behavior is respected when the form is rendered for the 1st time and works as expected.

However, if the form validation fails after submitting the form, all the IEF widgets appears as expanded, even if their fields were correct.

In situations where there are multiple IEF widgets at the same time in the page, this behavior can be confusing.

Our expected behavior is that only IEF widgets whose validation failed should be always open, but the rest, should respect the widget settings.

This is related and inspired by #2894213: Ensure visibility of invalid fields (serverside) β†’

Steps to reproduce

  • Create an entity with multiple IEF widgets (all of them set aas collapsed by default)
  • Go to the entity creation form and observe that all the widgets are collapsed
  • Force to fail validation of any of the fields and click on the form's "Sve" button
  • Validation fails, and the form is reloaded. However all the IEF widgets are expanded

Proposed resolution

Add logic to respect the expand/collapse desired logic after form validations fails.

Remaining tasks

User interface changes

None

API changes

None

Data model changes

None

πŸ› Bug report
Status

Needs work

Version

2.0

Component

Code

Created by

πŸ‡ͺπŸ‡ΈSpain plopesc Valladolid

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024