Skip to content

Numeric Field Preview Placeholders#16986

Merged
brandonkelly merged 5 commits into5.7from
feature/number-preview-placeholders
Apr 1, 2025
Merged

Numeric Field Preview Placeholders#16986
brandonkelly merged 5 commits into5.7from
feature/number-preview-placeholders

Conversation

@AugustMiller
Copy link
Copy Markdown
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