-
-
Notifications
You must be signed in to change notification settings - Fork 530
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The default Range field value can be incorrect when a Step value is set #2328
Comments
Where did you get that mysterious equation? |
Neat, thanks! |
This really confused me. No other fieldtypes get the defaults set by default. If anyone find this closed issue by the same reason as me, and wants to set the default to 0, you can then set the default to '0' in the .md |
Didn't notice your reply @ReneWeCode. Someone just pointed out the same |
Bug Description
The default value of a range field is typically
Max - Min / 2
(i.e.(20 - 2) / 2 = 9
). However, this does not work well if aStep
value is set. For example, suppose theStep
value is 2; using the example above, this would make the default value 9 instead of 10.I figured out that you can add
default: 10
to the yaml file to set the default, but I think a better option would be to allow manually setting a default or starting value from the CP.Extra Detail
Environment
Install method (choose one):
statamic/statamic
The text was updated successfully, but these errors were encountered: