Problem/Motivation

Nesting a checkbox under a .container-inline container form element causes it to get a ":" appended via CSS (:after pseudo-element). Individual radio elements inside a radios group as well as individual checkbox elements inside a checkboxes element seem to be already excluded from this.

Steps to reproduce

- Install Drupal with the standard profile
- Add a field with multi-value support to the page content type
- Create a view, use fields, add the field with multi-value support
- In the modal to configure the View field, expand "Multiple Field Settings"
- Notice that the "Reversed" and "First and Last Only" checkboxes show a ":" after the label.

Proposed resolution

Add a CSS rule to exclude a single checkbox from having a trailing ":", when nested in a .container-inline

Remaining tasks

- Implement fix
- Discuss and review

User interface changes

- Individual checkbox elements do not show a trailing ":", when nested inside a .container-inline.

API changes

- None

Data model changes

- None

Release notes snippet

- TODO

Issue fork drupal-3329699

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

jedihe created an issue. See original summary.

jedihe’s picture

StatusFileSize
new41.51 KB

Attaching screenshot from a simplytest.me instance.

UI bug replicated in a simplytest.me instance

jedihe’s picture

Issue summary: View changes

jedihe’s picture

Status: Active » Needs review
StatusFileSize
new611 bytes
new42.27 KB

Attaching patch from current MR.

Manually tested in a simplytest.me instance; bug is fixed:

Fixed labels for inline checkboxes, under Multiple field settings

Bushra Shaikh’s picture

Assigned: Unassigned » Bushra Shaikh
Bushra Shaikh’s picture

Assigned: Bushra Shaikh » Unassigned
jedihe’s picture

Issue summary: View changes
smustgrave’s picture

Priority: Normal » Minor
Status: Needs review » Reviewed & tested by the community
Issue tags: +Needs Review Queue Initiative

Can confirm this fixes the issue.

longwave’s picture

Status: Reviewed & tested by the community » Needs review

The same CSS is in starterkit_theme and Umami; should the same fixes be applied there?

Also, we have a similar rule for radios, so is it worth adding the same fix for .container-inline .form-type--radio label:after?

smustgrave’s picture

Status: Needs review » Needs work

Umami maybe? Would need to see this scenario from a frontend standpoint. (Screenshots needed)
Starterkit_theme I think yes as this could be copied for a backend theme maybe?

gauravvvv’s picture

Status: Needs work » Needs review
StatusFileSize
new1.85 KB
new1.82 KB

Updated it for radio element as well.
Also, Made changes in Starterkit_theme and Umami theme.

Umami maybe? Would need to see this scenario from a frontend standpoint. (Screenshots needed)

\
Tried finding a scenario where it is used, but didn't find any. We're using same CSS for all, to keep it uniform updated it in umami as well.

rishabh vishwakarma’s picture

StatusFileSize
new1.09 KB
new413 bytes

IGNORE

shani maurya’s picture

Assigned: Unassigned » shani maurya
shani maurya’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new1005.76 KB
new935.87 KB

I tested the Patch #12 and it is working fine. Please find the attached image for the results.

Thank You!!

shani maurya’s picture

Assigned: shani maurya » Unassigned

The last submitted patch, , failed testing. View results

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 13: 3329699-12.patch, failed testing. View results

longwave’s picture

+++ b/core/profiles/demo_umami/themes/umami/css/classy/components/container-inline.css
@@ -7,6 +7,8 @@
+.container-inline .form-type-radios label:after,

Should this be .form-type-radios or .form-type--radio?

I suppose we need a form with inline radio buttons to be able to actually test this.

gauravvvv’s picture

Status: Needs work » Needs review
StatusFileSize
new1.85 KB
new1.9 KB

Should this be .form-type-radios or .form-type--radio?

Yes it is .form-type--radio. I have updated the patch.

akshay kashyap’s picture

StatusFileSize
new81.51 KB
new61.68 KB

@Gauravvvv Thanks for the work. I have applied your patch its working fine on chrome and Firefox browser and also attached the screenshot for the same

akshay kashyap’s picture

StatusFileSize
new39.71 KB
akshay kashyap’s picture

aziza_a’s picture

Status: Needs review » Needs work

Applied the patch on #43 and it works, but have not updated there is a typo in class name that it should be .form-type--radio and not .form-type-radio, so moving it to need work again

gauravvvv’s picture

Status: Needs work » Needs review
StatusFileSize
new1.85 KB
new1.9 KB

Updated selector and attached interdiff.

Status: Needs review » Needs work

The last submitted patch, 25: 3329699-25.patch, failed testing. View results

kunal_sahu made their first commit to this issue’s fork.

kunal_sahu’s picture

Status: Needs work » Needs review

I have created an MR , Please review.

.container-inline .form-item label:last-child::after {
  content: none;
}

This CSS code will remove the trailing colon from the label of the last checkbox in a group of nested checkboxes inside an element with the class ".container-inline".

Hope this works. Thanks

nayana_mvr made their first commit to this issue’s fork.

smustgrave’s picture

Status: Needs review » Needs work

I believe #20 was correct. I can't find any reference to form-type--radio in the repo.

If the MR 3168 is the way. Explain why with screenshots.

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

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

jedihe’s picture

Issue summary: View changes
jedihe’s picture

Just fixed the merge conflict for MR 3168.

@kunal_sahu's work made me realize we have to handle 2 cases: with and without description. For elements with a description, keeping the trailing ':' could make sense (notice the gray description right after "Reversed:"):

Looking at the original code, it looks like the trailing ':' was added precisely to handle the case "with-description".

Taking all this into account, I'll switch to using only the :last-child selector.

@smustgrave: I was able to see .form-type--radio in the HTML source, probably constructed dynamically.

jedihe’s picture

Attaching the patch for the current state of the MR.

jedihe’s picture

StatusFileSize
new51.69 KB

New patch works great, IMHO:

(This is on Drupal 10.1.0 + patch, using Gin theme).

jedihe’s picture

Status: Needs work » Needs review
smustgrave’s picture

Status: Needs review » Needs work

Can before/after screenshots be updated.
Also can the MR be updated for 11.x please

Believe jedihe is working on this so please no one vulture it.

Thanks!

sd9121’s picture

Assigned: Unassigned » sd9121

sd9121’s picture

Assigned: sd9121 » Unassigned
Status: Needs work » Needs review
StatusFileSize
new113.16 KB
new103.64 KB

I have raised the PR against 11.x and have attached before/after screenshots to demonstrate the UI changes introduced by the patch.

smustgrave’s picture

Status: Needs review » Needs work

Screenshots appear to be the same but would need to be part of the summary

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.