Problem/Motivation

During the usability sessions, some participants struggled to figure out how to add multiple key|label values. Some didn't understand the relationship between the key and the label.

In good form design, we use the correct input types to provide guidance towards the expected input, a large freetext area is not intuitive and requires a lot of help text to understand.

Proposed resolution

Replace the text area with multiple inputs, automatically creating the value based on the machine name UI component.

Remaining tasks

Implement the suggestions
Design review
Test

User interface changes

Better widget than textarea for managing the list items. Something similar to https://www.drupal.org/project/options_element

API changes

None

Data model changes

None

Comments

mErilainen’s picture

Issue summary: View changes

This will most likely require an API change if done properly. Otherwise a transformation between an array and textarea has to be made like in the Options Elements module which I linked now to the issue description.

yched’s picture

IIRC @quicksketch had a contrib module which provided a UI pattern for those kind of needs.

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

tkoleary’s picture

Issue tags: +sprint
dmsmidt’s picture

The proposal makes key|label entry much understandable than it is currently. Maybe we can even make it more clear by not mentioning 'key' at all, but just naming it 'value'. That said, I miss the 'Remove value' options per row in the image.

The descriptions says we add certain markup (is this still so?), I would say we shouldn't advertise it when the 'simple' widget is used.
So maybe we can also have an advanced widget (the current one) as well. Because bulk entry also seems tiresome with the 'simple' widget.
If we support both we would need a toggle for the two input modes.

tkoleary’s picture

With select2 you can have a free text tag that transforms to a dismissable pill. Yet another reason to get that library into core.

dmsmidt’s picture

@tkoleary that lib is similar to Chosen right?

tkoleary’s picture

Right, but a bit more robust and well adopted

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.