Skip to content

Numeric Field Preview Placeholders #16986

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

Merged
merged 5 commits into from
Apr 1, 2025

Conversation

AugustMiller
Copy link
Contributor

@AugustMiller AugustMiller commented Mar 30, 2025

This changes the output of Number and Range fields, when previewed—and makes placeholder values of Range fields in element card attribute designers more “believable” for the field’s configuration.

  • Number — Prepends the prefix and appends the suffix to formatted values, when they’re specified. Placeholder values remain unchanged; I wasn't sure how to generate convincing values in cases where the min and/or max settings were absent!
  • Range — Appends the suffix to formatted decimal values, when specified. Placeholder values now respect the min, max, and step settings.

I elected to not introduce whitespace between the value and pre/suffix. This may be unsightly if to-date, developers had relied on the margin around inputs!

See also:


Current state of number fields, configured with a prefix and suffix:

number-format-field

New output in element indexes:

number-format-index

New output in element card attribute designer:

number-format-attr-designer

@brandonkelly brandonkelly merged commit 161ed99 into 5.7 Apr 1, 2025
@brandonkelly brandonkelly deleted the feature/number-preview-placeholders branch April 1, 2025 03:43
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.

2 participants