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

Issue fork drupal-3410993

Command icon 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

sidharth_soman created an issue. See original summary.

gauravvvv’s picture

Version: 10.2.x-dev » 11.x-dev

gauravvvv’s picture

Status: Active » Needs review
kanchan bhogade’s picture

Assigned: Unassigned » kanchan bhogade
sandeepsingh199’s picture

Status: Needs review » Needs work
StatusFileSize
new342.94 KB

Thanks for the patch @Gauravvvv, after applying the patch, it is focusing to that textbox but Error Message not showing.

kanchan bhogade’s picture

StatusFileSize
new1.37 MB

Hi @Gauravvvv
I tested MR !5977 on Drupal version 11.0 for the Claro Theme
The patch was applied successfully

Testing Steps:

  1. Set up the Drupal 11.0.
  2. Set the Claro theme
  3. Go to -> structure ->Article content type -> Manage Fields -> Add the field
  4. Leave the label input empty. Choose a field type that displays additional options requiring you to scroll down below (for example, 'formatted text'). Choose any option and hit continue.
  5. Observed no focus on the empty label input.
  6. Apply the shared patch & reverify the results.

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

shweta__sharma’s picture

StatusFileSize
new1.39 MB

Hi @Kanchan Bhogade,
It redirects to the label where needs to be focused or scrolled on validation. See the attached recording.
Thanks

shweta__sharma’s picture

Status: Needs work » Needs review
smustgrave’s picture

Status: Needs review » Needs work

Issue summary is incomplete

sidharth_soman’s picture

Issue summary: View changes
sidharth_soman’s picture

Issue summary: View changes
shweta__sharma’s picture

Status: Needs work » Needs review

Issue summary is updated changing the status to NR

kanchan bhogade’s picture

Assigned: kanchan bhogade » Unassigned
Status: Needs review » Reviewed & tested by the community
StatusFileSize
new806.93 KB

Hi
I tested MR !5977 on Drupal version 11.0 for the Claro Theme
The patch was applied successfully

Testing Steps:

  1. Set up the Drupal 11.0.
  2. Set the Claro theme
  3. Go to -> structure ->Article content type -> Manage Fields -> Add the field
  4. Leave the label input empty. Choose a field type that displays additional options requiring you to scroll down below (for example, 'formatted text'). Choose any option and hit continue.
  5. Observed no focus on the empty label input.
  6. Apply the shared patch & reverify the results.

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

quietone’s picture

Status: Reviewed & tested by the community » Needs work

There are failing tests. I am setting this to Needs work.

niranjan_panem’s picture

Checked in drupal 11 claro theme, not able to reproduce the issue.
below is the screen shot of foucs highlighting the empty label field.

screen shot of focus on label field

bnjmnm’s picture

re #16

Checked in drupal 11 claro theme, not able to reproduce the issue.
below is the screen shot of foucs highlighting the empty label field.

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.

niranjan_panem’s picture

I 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.

bnjmnm’s picture

I 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.

It is an issue for non-sighted and other assistive tech users, and it is functionality that Drupal core provides in other forms.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.

quietone’s picture

Status: Needs work » Postponed

The 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.

smustgrave’s picture

Project: Drupal core » Claro
Version: main » 3.0.x-dev
Component: Claro theme » Code
Status: Postponed » Needs work

Claro has moved to contrib