Entities 0.4.9: A step setting for decimal fields that cannot block a save
Entities 0.4.9 lets a decimal field declare its own "step", for example to stop the arrows of a four-place money field from moving 0.0001 at a time.
By default a decimal field’s step follows its number of places. A field can now set "step" to override it: "any" turns stepping off, so the arrows move by 1 while typed values keep all their places. The browser also checks typed values against the step and refuses to submit a form that does not match. So a step is used only when it still allows every value the field’s places allow: "any", or a step that divides evenly into the smallest place. A coarser step, such as "0.01" on a four-place field, falls back to the default, and so do zero, negative and unreadable values. Very small steps are written in plain digits, not exponent notation.
The README’s list of field types is current again, with decimal, image, video and heading.
Full release notes: Entities 0.4.9
0.4.9 · 30 August 2026
Added
- Decimal fields accept a
"step"prop to override the stepping the declaredscaleimplies —"any"turns stepping off entirely, which is the way to stop a 4-place money field’s spinner arrows crawling 0.0001 at a time while keeping every place typeable (#41).
Fixed
- An explicit decimal
"step"can no longer block saving the record. As merged, any"step"was passed through to the input, butstepis a browser validation constraint, not just spinner granularity: a form’ssubmitevent fires only after native validation passes, so"0.01"on a 4-place field left the browser refusing12.3456and the admin unable to save — the exact failure the scale-derived step exists to prevent. An override is now honoured only when it still admits every value the scale allows ("any", or a step dividing10^-scale); a coarser one falls back to the scale (#41). - Junk, zero and negative decimal steps fall back to the scale. The
explicit-step branch only rejected
"", so"0","-0.5","abc"and"0,01"reached the attribute — and a browser that cannot parsestepuses1, rejecting every decimal the type exists for. The value is now parsed and must be finite and positive (#41). - A float
"step"renders without exponent notation, throughDecimalrather thanto_string/1(to_string(0.00001)is"1.0e-5") — the ruledecimal_input_value/1already followed (#41).
Changed
- README field types are current again — the list and registry count said
12, four types after
decimal,image,videoandheadingwere added; the Numeric row now documentsdecimal’sscaleandstep.
Entities 0.4.9. Install or update: {:phoenix_kit_entities, "~> 0.4"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.