-
-
Notifications
You must be signed in to change notification settings - Fork 335
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(form): support inline fields group label for required attribute #2711
Conversation
@lubber-de please see https://jsfiddle.net/h9ta2wdj/ repro and https://dev.atk4.org/demos/collection/tablefilter.php example usage (click column header arrow to open column filter) In the repro, you can see extra vertical space is added - is that indented? And please also notice the "required" asterisk is not shown either - is that indented too? |
TLDR;
(Basically) Yes, it was, because it makes sure the (empty) label keeps its height when used inside a "fields" group to still align with other fields in the same line.
(Basically) Yes, as, when used inside a field group (like the screenshot above), only the first field usually gets the asterisk as all following fields in the same line belong to the same label (logical wise) Now, in your example, you used a single field and left the label empty which was not covert by this merged PR. To fix this in the meantime without the changes in #3060, just add one space character to your "empty" label, which will then add the asterisk. |
Followup of #2711 Whenever an empty label was used for a required single field or non-grouped, non-inline fields group, the label was still receiving an extra space to create a default height and did not display the asterisk. The intention of the space character was for empty non required fields to match same height when used inside a fields row. If one does not want a label at all and does not want to make this field required, you would not render the label at all and wont get additional space then
Description
A required Inline fields label does not get an asterisk and does not get a state color
To fix the state color i had to make use of the
:has()
class selector. This isnt supported by all browsers, so in those browsers this feature wont work.I also fixed positioning of fields when an empty label is used
Testcase
Remove CSS to see issue
https://jsfiddle.net/lubber/6po2btaw/23/