Price element #states

Created on 18 August 2024, 29 days ago
Updated 2 September 2024, 14 days ago

Describe your bug or feature request.

The price element creates a container with a number and select (currency code) element.

It passes down many of the properties, e.g. #required and #ajax.

It does not pass down #states for some reason.

For some states, e.g. visible, this isn't a huge deal, since hiding the price container also hides the contained number and select elements.

For others, e.g. required, this causes an issue as it can't be used with containers.

Besides the missing core UX, this also prevents other modules, like client side validation, from properly picking up these required fields.

We should pass #states down, like we do #ajax.

If a bug, provide steps to reproduce it from a clean install.

Create a form with two elements, one being a checkbox and the other being a price.

Add #states to the price element, with required dependent on whether the checkbox is checked or not.

As you toggle the checkbox, the price inputs should add/remove form required behavior. (Change in class, adding * to the label suffix.)

🐛 Bug report
Status

Fixed

Version

2.0

Component

Price

Created by

🇺🇸United States TomTech

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024