jquery-timepicker icon indicating copy to clipboard operation
jquery-timepicker copied to clipboard

useSelect, minTime, and required

Open olaulau opened this issue 1 year ago • 2 comments

Hi ;

Here are some small bugs with those jquery-timepicker options :

  • "required" attr is only correctly applied by browser if we don't use "useSelect" option
  • "minTime" is only applied to the list of available values in the list, but not enforced as minimal value . if there was a smaller value set, this value will still be posted
    • in this case, if we add the "useSelect" option, the is no selected value, empty value are posted.
      • if we add "required" attribute, the form isn't posted but we don't see any error (as if the error is on the hidden field)
  • when using "minTime" with "useSelect" and an initial empty value, it selects this minimal value (but it doesn't without "useSelect" option)
  • when using "useSelect", "ui-timepicker-[field_name]" values are posted alongside of "[field_name]" values

Hope this is detailed enough, and you will have some ideas to fix / workaround those bugs. Thanks.

olaulau avatar Feb 12 '24 11:02 olaulau

  • with initial empty value and "useSelect" option, first (minimal) value is automatically selected (empty value cannot be selected, despite the field is required or not). not the same behavior without "useSelect" option.

olaulau avatar Feb 12 '24 11:02 olaulau

  • with initial empty value and "useSelect" option, first (minimal) value is automatically selected (empty value cannot be selected, despite the field is required or not). not the same behavior without "useSelect" option.

nevermind, there is a workaround : noneOption: [""]

olaulau avatar Feb 12 '24 12:02 olaulau