Add option to choose widget open by default or not

Issue information

From user: maursilveira

Related to !11 (closed)

Contribution record

Fork management

I have searched, and I could not find any existing issue for this. Please let me know if this is a duplicate.

Problem/Motivation

When a field is set to use Link (with Attributes), the widget is loaded open by default if there is any enabled attribute selected. In many cases, editors do not want to set any attributes whatsoever. It would be an interesting feature to provide the ability to choose if the widget will be open or collapsed by default.

Steps to reproduce

1. Set a Link type field to use widget "Link (with Attributes)".
2. Enable at least one attribute.
2. Go to add/edit page for the respective content type (or any entity type) and check the details element for "Attributes" is open by default.

Proposed resolution

Add a checkbox field to the field widget configuration where it is possible to choose if the widget details element should be loaded open or closed by default.

Remaining tasks

Modify code.

User interface changes

A new checkbox field on "Manage form display".

API changes

N/A.

Data model changes

N/A.

Edited by drupalbot
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information