@symply.io/basic-components 1.5.7-alpha.4 → 1.5.7-alpha.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -60,20 +60,6 @@ function useInteractions(props) {
60
60
  }
61
61
  }
62
62
  }
63
- if (String(val).startsWith("0")) {
64
- if (selectionStart &&
65
- 0 < selectionStart &&
66
- ![
67
- "Backspace",
68
- "ArrowUp",
69
- "ArrowDown",
70
- "ArrowLeft",
71
- "ArrowRight",
72
- "."
73
- ].includes(key)) {
74
- event.preventDefault();
75
- }
76
- }
77
63
  }
78
64
  }
79
65
  }, [value, minValue, integerOnly]);
@@ -113,6 +99,10 @@ function useInteractions(props) {
113
99
  else if (excludedValue.includes(strVal)) {
114
100
  onChange("");
115
101
  }
102
+ else if (strVal.startsWith("0")) {
103
+ var newValue = strVal.replace(/^(0+)(?=((0|[1-9])\d*\.))/g, "");
104
+ onChange(newValue);
105
+ }
116
106
  }, [value, onChange]);
117
107
  var onOpenTooltip = useCallback(function () {
118
108
  setTooltipOpen(true);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@symply.io/basic-components",
3
- "version": "1.5.7-alpha.4",
3
+ "version": "1.5.7-alpha.5",
4
4
  "description": "Basic and reusable components for all frontend of Symply apps",
5
5
  "keywords": [
6
6
  "react",