You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I need to show one error per validation method in the group, rather than one error per group. For example: "Field One and Field Two may not be longer than 10 characters." and "Field Three and Field Four are required", as separate but adjacent error elements, so that the aria-describedby on each field can point only to the appropriate message for each field. Currently all fields in a group are aria-describedby the same error, even if some of the fields in the group are valid. There needs to at least be an option to change this.
See related feature request for group messages and rules: #2416
I'm thinking this could be implemented as an option for backwards compatibility:
I can think of multiple ways that the success setting could work here (is the message always blank on success, or is there ever any content that would necessitate an aria-describedby relationship to valid fields?), or we can decide that it's not compatible with this option.
Hit the tab key to move focus out of the First Name field
Notice that an "Invalid format" message appears for the Name group
Hit the Submit button to submit the form
Current behavior
There's one error message for the Name group, which says "This field is required." The "Invalid format" message is no longer there.
If you enter "Test" in the Middle Name and hit tab, the field is marked as valid but is still aria-describedby the error message.
Requested behavior
The "Invalid format" message and the required message are both displayed as adjacent elements. First Name is aria-describedby the format message. Middle Name and Last Name are aria-describedby the required message. (The message text should also be more user-friendly--"First Name cannot contain digits." and "Middle and Last Name are required."-- I just didn't implement that here for time reasons.)
If you enter "Test" in the Middle Name and hit tab, the field should be marked as valid, and it's aria-describedby attribute should be modified/removed (depending on whether there's another value) so it no longer points to the required message. (Also, in the user-friendly version of the message, the text is modified to "Last Name is required.")
The text was updated successfully, but these errors were encountered:
I'd like to branch this feature off of PR #2410 (adding an option to remove aria-describedby when there's no longer an error) so that the aria-describedby for each error type can point specifically to the fields with that error, instead of having all the errors describe everything in the group. Ideally I'd also like to include #2418 because it'll be extremely tedious to pass the same message function separately for every field in a group.
If I were to keep this feature separate from the other two (or to branch it from just one of them), is it significantly more likely to be accepted? I need to have these features together either way (and plan to develop them), but I'd like to contribute if I can.
This issue/proposal has been automatically marked as idle and stale because it hasn't had any recent activity. It will be automatically closed if no further activity occurs. If you think this is wrong, or the problem still persists, just pop a reply in the comments and one of the maintainers will (try!) to follow up.
Thank you for contributing :)
I need to show one error per validation method in the group, rather than one error per group. For example: "Field One and Field Two may not be longer than 10 characters." and "Field Three and Field Four are required", as separate but adjacent error elements, so that the
aria-describedby
on each field can point only to the appropriate message for each field. Currently all fields in a group arearia-describedby
the same error, even if some of the fields in the group are valid. There needs to at least be an option to change this.See related feature request for group messages and rules: #2416
I'm thinking this could be implemented as an option for backwards compatibility:
I can think of multiple ways that the
success
setting could work here (is the message always blank on success, or is there ever any content that would necessitate anaria-describedby
relationship to valid fields?), or we can decide that it's not compatible with this option.Example
Demo steps
Current behavior
There's one error message for the Name group, which says "This field is required." The "Invalid format" message is no longer there.
If you enter "Test" in the Middle Name and hit tab, the field is marked as valid but is still
aria-describedby
the error message.Requested behavior
The "Invalid format" message and the required message are both displayed as adjacent elements. First Name is
aria-describedby
the format message. Middle Name and Last Name arearia-describedby
the required message. (The message text should also be more user-friendly--"First Name cannot contain digits." and "Middle and Last Name are required."-- I just didn't implement that here for time reasons.)If you enter "Test" in the Middle Name and hit tab, the field should be marked as valid, and it's
aria-describedby
attribute should be modified/removed (depending on whether there's another value) so it no longer points to the required message. (Also, in the user-friendly version of the message, the text is modified to "Last Name is required.")The text was updated successfully, but these errors were encountered: