Problem/Motivation

shortcut.admin.js exists to select the New set option as soon as something is being entered in the Label textfield on the user shortcut set selection form.

This functionality does not work currently.

A screenshot of the user shortcut set selection form with text having been entered into the label textfield but the New set radio not being selected

In the worst case the user enters something in the textfield expecting a new shortcut set to be created but upon submitting the form the data is simply ignored because the New set radio was not selected.

Steps to reproduce

  1. Visit /user/1/shortcuts
  2. Type something into the textfield

Expected result:
The New result radio above the textfield is selected.

Actual result:
The New result radio above the textfield is not selected.

Proposed resolution

Instead of fixing the JavaScript, let's replace this non-standard UI feature with a standard pattern used all across core: #states. I.e. let's only show the textfield if New set is selected explicitly.

As part of this let's also actually show the Label title of the textfield like we do on other forms.

A screenshot of the user shortcut set selection form after applying the patch showing just the shortcut set selection radio with Default selected
A screenshot of the user shortcut set selection form after applying the patch showing the shortcut set selection radio with New set selected and the Label textfield showing below including the form element title

https://www.drupal.org/files/issues/shortcut-after-2.png

Remaining tasks

User interface changes

The label textfield on the user shortcut set selection page only appears if New set is selected above and has a visible title.

API changes

None.

Beta phase evaluation

Reference: https://www.drupal.org/core/beta-changes
Issue category Bug
Issue priority Normal because most users will probably never hit this
Unfrozen changes Unfrozen because it only changes markup
Prioritized changes The main goal of this issue is usability
Disruption No disruption
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

tstoeckler’s picture

Issue summary: View changes
FileSize
13.43 KB
18.17 KB

Here we go.

tstoeckler’s picture

Status: Active » Needs review
FileSize
2.51 KB
dawehner’s picture

Status: Needs review » Reviewed & tested by the community

Nice cleanup!

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Sweet patch. This issue is a normal bug fix, and doesn't include any disruptive changes, so it is allowed per https://www.drupal.org/core/beta-changes. Committed de5d27e and pushed to 8.0.x. Thanks!

  • alexpott committed de5d27e on 8.0.x
    Issue #2427161 by tstoeckler: shortcut.admin.js broken, replace with #...

Status: Fixed » Closed (fixed)

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