Skip to content

Commit

Permalink
Fix: Show empty values as 0
Browse files Browse the repository at this point in the history
  • Loading branch information
jonnitto committed Oct 12, 2024
1 parent 9eef10a commit 23d6648
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 30 deletions.
2 changes: 1 addition & 1 deletion Resources/Private/RangeEditor/Editor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function Editor(props) {

const options = { ...defaultProps.options, ...props.options };
const { value, highlight, i18nRegistry } = props;
const valueAsString = value === 0 ? "0" : value || "";
const valueAsString = !value ? "0" : value;
// Calculate the width of the input field based on the length of the min, max and step values
const numLength = (value) => value.toString().length;
const additionalStepLength = numLength(options.step) - 1;
Expand Down
2 changes: 1 addition & 1 deletion Resources/Public/Plugin.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 23d6648

Please sign in to comment.