Skip to content
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

Remove trailing space from numericStepper when suffix doesn't exist #1218

Merged
merged 1 commit into from
Jun 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Fixed
- Remove trailing space from `numericStepper` when there isn't a suffix

## [9.119.0] - 2020-05-21

Expand Down
3 changes: 2 additions & 1 deletion react/components/NumericStepper/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ const validateValue = (value, min, max, defaultValue) => {
}

const formattedDisplayValue = (value, unitMultiplier, suffix) => {
const parsedSuffix = suffix ? ` ${suffix}` : suffix
return `${Math.round((value * unitMultiplier + Number.EPSILON) * 100) /
100} ${suffix ? suffix : ''}`
100}${parsedSuffix}`
}

const validateDisplayValue = (value, min, max, suffix, unitMultiplier) => {
Expand Down