verbb / formie

The most user-friendly forms plugin for Craft CMS.
Other
93 stars 69 forks source link

[3.x]: Issue with option `required field` for field date #1940

Closed Megafry closed 2 days ago

Megafry commented 1 week ago

Describe the bug

If the option Required Field is set for the field date, all the sub-fields should automatically be mandatory, and the label should show the *

Steps to reproduce

  1. Import this form formie.json
  2. Open in the frontend
  3. The Field with the date picker is mandatory, but the * is missing, even if the sub-fields are set as mandatory.
  4. The field without date picker is set as mandatory and also the * is missing.
  5. To make it visible, I need to hide the label and make the label of the sub-fields visible.

Form settings

Craft CMS version

5.2.0

Plugin version

3.0.0-beta.15

Multi-site?

No response

Additional context

No response

engram-design commented 1 week ago

This is actually a mistake on my part, where the required field setting shouldn't be available at the top-level field, similar to other sub-fields. It's something we might introduce one day, but I think it's a little confusing to have a setting at the field level that can override the sub-field level, particularly if you're trying to toggle it on or off and can't find which setting is going to change that.

But more to the point, this is mostly because of confusing behaviour between the different display types of a Date field. You have a Flatpickr "calendar" option which is always a single field even if you pick date + time. Then you have a "calendar" option which is the native browser date picker, which is 2 fields (one for date, one for time).

Formie 2 is a good time to introduce a more streamlined approach to this with a slightly breaking change. We've now introduced a "Calendar (Simple)" and "Calendar (Advanced)" display type option, with "Simple" being the default (browser-native). I've never really liked the "hidden away" datepicker setting.

The original issue should also be fixed for the next release. To get this early, run composer require verbb/formie:"dev-craft-5 as 3.0.0-beta.15".

engram-design commented 2 days ago

Fixed in 3.0.0-beta.16