Skip to content

Conversation

ELowry
Copy link

@ELowry ELowry commented Sep 10, 2025

Addresses statamic/ideas#1368 and statamic/ideas#1092

This PR introduces support for the native HTML min, max, and step attributes to the Integer fieldtype:

  • Adds min, max, and step options to the blueprint builder UI.
  • Renders the attributes in the field's HTML view.
  • Renders the attributes in the field's Vue rendering.

Important note

I've done my best to follow the existing patterns in the codebase, but as I'm not deeply familiar with all of Statamic's architecture and do not currently have time to test my changes in a sandbox.
However, since the changes seem pretty straightforward, I thought it best to still create a PR with this message included; please excuse me for the break in protocol.

Thanks!

- Adds min, max, and step options to the blueprint builder UI.
- Renders the attributes in the field's HTML view.
- Renders the attributes in the field's Vue rendering.
@ELowry ELowry changed the title feat: Add min, max, and step attributes to Integer fieldtype [4.x] Add min, max, and step attributes to Integer fieldtype Sep 10, 2025
@ELowry ELowry changed the title [4.x] Add min, max, and step attributes to Integer fieldtype [5.x] Add min, max, and step attributes to Integer fieldtype Sep 10, 2025
class_attributes_separation
indentation_type
class_attributes_separation
@ELowry ELowry marked this pull request as ready for review September 10, 2025 20:27
@ELowry
Copy link
Author

ELowry commented Oct 4, 2025

I have now fully tested this in a local deployment, and can confirm that it functions as intended.

Further testing is still worth it IMHO, as I was not familiar with this local deployment method and may not have done it fully properly.

Use in a blueprint configuration:

image

The blueprint in use

image

The generated html

<input id="field_quantity" name="quantity" type="number" step="5" min="10" max="100" class="input-text">

How it acts

The browser correctly uses the min, max, and step values, gating and "stepping" the input.

The result in a simple view

image

Note: I changed the value between these two screenshots, ignore the difference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant