Implement errorElement() in Widgets

Created on 6 September 2023, over 1 year ago
Updated 8 September 2023, over 1 year ago

Problem/Motivation

Constraint violations (and form validation errors ostensibly), are not able to target specific form elements within the smart date fieldset.

Steps to reproduce

  1. Create a custom constraint for a smart date field
  2. Cause the constraint to fire a validation violation on the 'value' element.
  3. When saving, see that the theme highlights all field elements with the red "error" border.

Proposed resolution

Implement errorElement() in SmartDateDefaultWidget.php()

Remaining tasks

Do the work

User interface changes

Errors allow targeting specific smart date field elements

API changes

n/a

Data model changes

n/a

πŸ“Œ Task
Status

Needs review

Version

4.1

Component

User interface

Created by

πŸ‡ΊπŸ‡ΈUnited States coderdan

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @coderdan
  • Status changed to Needs review over 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States coderdan
  • πŸ‡ΊπŸ‡ΈUnited States coderdan

    The patch in #2 prevents targeting elements outside of the time_wrapper sub-element, such as the 'make recurring' checkbox. This patch should solve for that by removing the time_wrapper as the sole parent for all elements.

Production build 0.71.5 2024