Closed mclemente closed 1 month ago
Seems like you should just be using step
and not integer
Then there's no guarantee the number is an integer, e.g. someone sets the setting's value to a float.
Also, I forgot to add integer
to the reproduction code.
Assigning a step
to the input has some significant UX implications that may not be desired. If you wish this behavior you can set step: 1
in your field definition. I don't think I'm in favor of this proposal.
Would validating that the step
is itself an integer not be enough? Why must it be only ever 1
?
Atropos, this is a bug report, not a feature request. I'm not requesting for FoundryVTT to set step: 1
if integer: true
(see my field on Reproduction Steps), it is already doing that and I'm reporting it as a bug since it overrides my own step
value to 1 instead of rounding it to the closest integer.
The code in the "What Happened" section is an excerpt from NumberField#_toInput
, not a suggestion.
If I create a NumberField with { integer: true, step: 10 }
, its step becomes 1.
I could've made it more clear on my post, but I've reported a similar issue with NumberField earlier like that (https://github.com/foundryvtt/foundryvtt/issues/11256).
What happened?
What ways of accessing Foundry can you encounter this issue in?
Reproduction Steps
What core version are you reporting this for?
12.329
Relevant log output
No response
Bug Checklist