Skip to content

Commit

Permalink
Bug Fix - The logic for the range was not valid.
Browse files Browse the repository at this point in the history
  • Loading branch information
gunjandatta committed Dec 17, 2020
1 parent effdb17 commit ec0cfb5
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dist/gd-sprest-bs.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/gd-sprest-bs.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gd-sprest-bs",
"version": "6.5.0",
"version": "6.5.1",
"description": "SharePoint JavaScript, TypeScript and Web Components designed using the Bootstrap framework.",
"main": "build/index.js",
"typings": "@types/index.d.ts",
Expand Down
5 changes: 4 additions & 1 deletion src/components/field.ts
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,9 @@ export const Field = (props: IFieldProps): IField => {
let numberField = props.field as Types.SP.FieldNumber;
let numberProps = controlProps as Components.IFormControlPropsNumberField;

// Set the default value
numberProps.value = numberField.DefaultValue;

// See if this is a percentage
if (numberField.ShowAsPercentage) {
// Set the type
Expand All @@ -441,7 +444,7 @@ export const Field = (props: IFieldProps): IField => {
numberProps.value = numberProps.value * (numberProps.max == 100 && numberProps.value < 1 ? 100 : 1);
}
// Else, see if the min/max values are defined
else if (typeof (numberField.MaximumValue) == "number" && typeof (numberField.MinimumValue) == "number") {
else if ((typeof (numberField.MaximumValue) == "number" && numberField.MaximumValue != Number.MAX_VALUE) && (typeof (numberField.MinimumValue) == "number" && numberField.MinimumValue != Number.MIN_VALUE)) {
// Update the properties to display a range
numberProps.type = Components.FormControlTypes.Range;
numberProps.max = numberField.MaximumValue;
Expand Down

0 comments on commit ec0cfb5

Please sign in to comment.