Skip to content

Proposal: Separate attributes for main form error and field error #152

@lemmon

Description

@lemmon

Currently, attributes defined under 'error' => ['class' => 'error-class'] are applied to both the main form error and each field error. This makes it difficult to style them differently — for example, to give the main form error a distinct layout.

Targeting field errors individually is only possible by adding custom classes for every field type, which leads to unnecessary repetition.

Proposal

Allow separate configuration for form and field errors, for example:

'error' => ['class' => 'form-error-class'],
'field' => [
  'error' => ['class' => 'field-error-class'],
],

If the 'error' prop is extracted at the appropriate level, this solution could remain fully backward compatible even.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions