Problem/Motivation
Using Drupal 10.2.0 and PHP 8.1.4.
If I miss filling out the 'label' input and try to add a new field, the focus doesn't shift onto the erroneous input element. I've attached a screen recording which illustrates this.
Steps to reproduce
1. Go to /admin/structure/types/manage/article/fields/add-field.
2. Leave the label input empty. Choose a field type which displays additional options requiring you to scroll down below (for example, 'formatted text'). Choose any option and hit continue.
3. Observe the page refreshing but not focusing on the empty label input.
Proposed resolution
Perhaps make add the require option on the label field?
Remaining tasks
Decide how to resolve.
User interface changes
Label field should come into focus if left empty. Illustrated the bug in the attached video.
API changes
N/A
Data model changes
N/A
Release notes snippet
TBD
| Comment | File | Size | Author |
|---|---|---|---|
| #16 | Screenshot-of-label-field-highlighted-on-leaving-empty.png | 122.16 KB | niranjan_panem |
| #14 | Welcome_-_-Drupal11with-git.mp4 | 806.93 KB | kanchan bhogade |
| #8 | screen-capture-9.mp4 | 1.39 MB | shweta__sharma |
| #7 | emptyaddfield.mp4 | 1.37 MB | kanchan bhogade |
| #6 | 3410993_Error.png | 342.94 KB | sandeepsingh199 |
Issue fork drupal-3410993
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
gauravvvv commentedComment #4
gauravvvv commentedComment #5
kanchan bhogade commentedComment #6
sandeepsingh199 commentedThanks for the patch @Gauravvvv, after applying the patch, it is focusing to that textbox but Error Message not showing.
Comment #7
kanchan bhogade commentedHi @Gauravvvv
I tested MR !5977 on Drupal version 11.0 for the Claro Theme
The patch was applied successfully
Testing Steps:
Test Result:
The patch was applied successfully, and the Error does not come into focus on the 'add fields' fixed;
But when the error comes into focus, the page scrolling is not up to the focus area.
Moving to Needs Work
The video is attached for reference
Comment #8
shweta__sharma commentedHi @Kanchan Bhogade,
It redirects to the label where needs to be focused or scrolled on validation. See the attached recording.
Thanks
Comment #9
shweta__sharma commentedComment #10
smustgrave commentedIssue summary is incomplete
Comment #11
sidharth_soman commentedComment #12
sidharth_soman commentedComment #13
shweta__sharma commentedIssue summary is updated changing the status to NR
Comment #14
kanchan bhogade commentedHi
I tested MR !5977 on Drupal version 11.0 for the Claro Theme
The patch was applied successfully
Testing Steps:
Test Result:
The patch was applied successfully, and the Error does not come into focus on the 'add fields' fixed;
Moving to RTBC
Video for reference
Comment #15
quietone commentedThere are failing tests. I am setting this to Needs work.
Comment #16
niranjan_panem commentedChecked in drupal 11 claro theme, not able to reproduce the issue.
below is the screen shot of foucs highlighting the empty label field.
Comment #17
bnjmnmre #16
You literally reproduced the issue. In your screenshot, the Text (plain) option is focused (notice the green outline), not the label field. While it's true the label field is red, it is not the focused element.
Comment #18
niranjan_panem commentedI don't think focus on empty label is an issue. Already we are displaying the error messages and highlighting the label with red color. Intuitively user get know what happened on that field.
Comment #19
bnjmnmIt is an issue for non-sighted and other assistive tech users, and it is functionality that Drupal core provides in other forms.
Comment #21
quietone commentedThe Claro theme was approved for removal in #3576460: [policy, no patch] Deprecate and remove Claro.
This is Postponed. The status is set according to two policies. The Remove a core extension and move it to a contributed project and the Extensions approved for removal policies.
The deprecation work is in #3576668: [meta] Tasks to deprecate Claro and the removal work in #3584638: [meta] Tasks to remove the Claro theme.
Comment #22
smustgrave commentedClaro has moved to contrib