You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please specify what version of the library you are using: [3.20.0]
Expected / Desired Behavior / Question
The up/down buttons of numeric fields should increment or decrease the entered value.
Observed Behavior
When there is no limit for the values of the numeric column, SharePoint returns very large values for min and max (I guess max float) which cause the numeric up down buttons in the DynamicForm to stop functioning. If there is no value, clicking one of them will enter 0 in the textbox. Further clicks (or starting with a manually entered value) will not change the number. It is still possible to change the value by typing.
I fixed the issue by adding an additional check for the values, reducing it to MIN/MAX_SAFE_INTEGER in DynamicForm.tsx:
Category
[ ] Enhancement
[X] Bug
[ ] Question
Version
Please specify what version of the library you are using: [3.20.0]
Expected / Desired Behavior / Question
The up/down buttons of numeric fields should increment or decrease the entered value.
Observed Behavior
When there is no limit for the values of the numeric column, SharePoint returns very large values for min and max (I guess max float) which cause the numeric up down buttons in the DynamicForm to stop functioning. If there is no value, clicking one of them will enter 0 in the textbox. Further clicks (or starting with a manually entered value) will not change the number. It is still possible to change the value by typing.
I fixed the issue by adding an additional check for the values, reducing it to MIN/MAX_SAFE_INTEGER in DynamicForm.tsx:
minimumValue: minValue ? (minValue < Number.MIN_SAFE_INTEGER ? Number.MIN_SAFE_INTEGER : minValue) : undefined,
maximumValue: maxValue ? (maxValue > Number.MAX_SAFE_INTEGER ? Number.MAX_SAFE_INTEGER : maxValue) : undefined,
The values get rendered by DynamicField.tsx which already contains this check:
let minValue = minimumValue !== undefined && minimumValue !== -(Number.MAX_VALUE) ? minimumValue : undefined;
let maxValue = maximumValue !== undefined && maximumValue !== Number.MAX_VALUE ? maximumValue : undefined;
So it might be a better solution to fix the DynamicField instead of the DynamicForm.
The text was updated successfully, but these errors were encountered: