Required form label for horizontal forms #1161
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
According to the Bootstrap docs labels do get
col-form-label
in horizontal forms and notform-label
as in classical form layout. See examples at https://getbootstrap.com/docs/5.2/forms/layout/#horizontal-form . Some frameworks that render forms (e.g. PHP Symfony) do stick to the original definition and I was missing the * in some forms.Tabler until now does only style
form-label
, there is no mention ofcol-form-label
.This was okay in most cases, but the
required
class isn't applied (compare before and after screenshots).I adjusted the demo, so there is a showcase of the
required
class as well in horizontal forms. I also adjusted the used label class, so the demo HTML matches the HTML from the Bootstrap docs.Before:
After:
The screenshots were taken after adjusting the HTML (see required * on the left) but before adjusting the CSS.