Skip to content

fix(pat-validation): Do not share errors between same-named inputs. - #1313

Merged
thet merged 2 commits into
masterfrom
thet/fix-validation-groups
Nov 29, 2026
Merged

thet merged 2 commits into
masterfrom
thet/fix-validation-groups

Conversation

@thet

@thet thet commented Nov 29, 2026

Copy link
Copy Markdown
Member

Only errors which belong to the group of inputs with the same name -
min-values, max-values and a required radio group - are shared between
these inputs. All other errors belong to the single input.

Before, checking one input cleared the errors of all inputs with the same
name. E.g. a date and a time input with the same name: checking the time
input cleared the not-after error of the date input and an invalid form
could be submitted. This was a regression since 9.11.1.

The group error is computed the same way by any input of the group, also
if min-values or max-values is defined on only one input. The group error
message is shown once after the last input of the group and only if no
input of the group shows its own error.

Breaking change for JavaScript users: set_error() and remove_error() only
affect the given input. remove_error() defaults to all_of_group = false.
The new methods check_group(), render_error_message() and
render_group_error_message() handle the group errors and messages.

Ref: ADR 0008

Assisted-by: Claude Opus 5.5

thet added 2 commits November 29, 2026 10:34
Only errors which belong to the group of inputs with the same name -
min-values, max-values and a required radio group - are shared between
these inputs. All other errors belong to the single input.

Before, checking one input cleared the errors of all inputs with the same
name. E.g. a date and a time input with the same name: checking the time
input cleared the not-after error of the date input and an invalid form
could be submitted. This was a regression in 9.12.0-alpha.1.

The group error is computed the same way by any input of the group, also
if min-values or max-values is defined on only one input. The group error
message is shown once after the last input of the group and only if no
input of the group shows its own error.

Breaking change for JavaScript users: set_error() and remove_error() only
affect the given input. remove_error() defaults to all_of_group = false.
The new methods check_group(), render_error_message() and
render_group_error_message() handle the group errors and messages.

Ref: ADR 0008

Assisted-by: Claude Opus 5.5
@thet
thet force-pushed the thet/fix-validation-groups branch from 0b75da0 to 1021419 Compare November 29, 2026 09:42
@thet
thet merged commit a14504a into master Nov 29, 2026
1 check passed
@thet
thet deleted the thet/fix-validation-groups branch November 29, 2026 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant