You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#1141 describes a way to set the current date and time as a default for a field by using a template. Usage of the default value in combination would be even more intuitive.
Actual behavior
setting any template renders a field as read-only. Templates in default values do not work (see #142 (comment))
The text was updated successfully, but these errors were encountered:
simontaurus
changed the title
Missing option to set a default value using a template / template render fields as read-only
Missing option to set a default value using a template / templates render fields as read-only
Feb 4, 2024
Okay, so currently default is the way to set a static value until the user overrides it. template will enforce a dynamical value without any option for the user to change it (read-only). For usecases like the receiving_data of a shipment I'm looking for a way in between to set the current date (now) as default but allow the user to change it to any other date (e. g. yesterday).
Setting a now callback as template works but this renders the field as readonly.
A solution could be to allow templates in default values (see #142 (comment)), so that "default": "now" or "default": "{{now}}" is resolved to the current datetime (e.g. "default": "2024-02-04T04:31:08.050Z") at the initialisation of the editor but the user could still set another datetime.
General information
Expected behavior
#1141 describes a way to set the current date and time as a default for a field by using a template. Usage of the default value in combination would be even more intuitive.
Actual behavior
setting any template renders a field as read-only. Templates in default values do not work (see #142 (comment))
Steps to reproduce the behavior
Direct link to example: playground
The text was updated successfully, but these errors were encountered: