Incompatible with Clientside Validation and required checkbox

Created on 19 August 2023, about 1 year ago
Updated 2 August 2024, about 1 month ago

Problem/Motivation

Hi,

When on a user register form, there is a required boolean field displayed as checkbox and when using Clientside Validation , the input is hovered by the validation message and so it is no more possible to check the checkbox.

See attached screenshots.

I made a quick workaround for my website, if this help:

/* Quick and dirty fix. */
.form-checkbox.required.form-boolean.form-boolean--type-checkbox.error + .form-item--error-message {
  padding-inline-start: 50px;
}
.form-checkbox.required.form-boolean.form-boolean--type-checkbox.error ~ .checkbox-toggle {
  position: absolute;
  top: 0;
}

Steps to reproduce

Use Gin Login, Clientside Validation and have a require boolean field on user register form.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Feature request
Status

Needs work

Version

3.0

Component

User interface

Created by

🇫🇷France Grimreaper France 🇫🇷

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @Grimreaper
  • 🇫🇷France Grimreaper France 🇫🇷

    Also I had to add for coloring:

    .form-item--error-message {
      color: var(--input--error-border-color);
    }
    
  • Status changed to Postponed: needs info 11 months ago
  • 🇨🇭Switzerland saschaeggi Zurich

    @Grimreaper can you test if this is a bug related only to Gin Login or if it happens also in Gin in general? As then we'd better move this issue there to generally fix it.

  • Status changed to Needs work 11 months ago
  • 🇫🇷France Grimreaper France 🇫🇷

    Hi @saschaeggi,

    I can confirm this happens in Gin in general.

    I have tested on a node create form where I added a required boolean field:

  • Status changed to Closed: outdated 3 months ago
  • 🇨🇭Switzerland saschaeggi Zurich
  • Status changed to Needs work about 2 months ago
  • 🇫🇷France Grimreaper France 🇫🇷

    Hi,

    With Gin 3.0.0-rc13, The checkbox is now accessible ok, but what about adding an error color on the text?

  • 🇨🇭Switzerland saschaeggi Zurich

    Can you create a MR to add it? Cheers!

  • 🇫🇷France Grimreaper France 🇫🇷
  • Status changed to Needs review about 2 months ago
  • 🇫🇷France Grimreaper France 🇫🇷

    Hi,

    MR created.

    I have manually edited the CSS files and also handling error message outside of checkbox, like text fields.

    See attached screenshots.

  • Pipeline finished with Failed
    about 2 months ago
    Total: 208s
    #231846
  • 🇨🇭Switzerland saschaeggi Zurich

    @Grimreaper I've pushed some code simplification as we can generally make label.error available in form.css (pretty sure there will be more situations).

    Please have a look so we can proceed with this 👀

    Thank you!

  • Status changed to Needs work about 1 month ago
  • 🇫🇷France Grimreaper France 🇫🇷

    Hi @saschaeggi,

    Thanks for the simplification.

    It's ok for checkbox, but does not take other form elements into accounts.

  • Status changed to Needs review about 1 month ago
  • 🇨🇭Switzerland saschaeggi Zurich

    @Grimreaper 💯, can you check the latest changes? Thank you!

  • Status changed to Needs work about 1 month ago
  • 🇫🇷France Grimreaper France 🇫🇷

    Thanks @saschaeggi.

    Now ok for textfield, but broken (or current behavior without the MR) on checkbox.

    As shown on the screenshot, the problem is this selector :not(.form-checkboxes):not(td):not(.tabledrag-cell-content__item):not(.media-library-item__click-to-select-checkbox):not(.field-content):not(.tablesaw-cell-content) > .form-type--checkbox label

Production build 0.71.5 2024