@rio-cloud/rio-uikit 0.16.4-beta.16 → 0.16.4-beta.17
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.
|
@@ -87,14 +87,16 @@ const SaveableInput = (props) => {
|
|
|
87
87
|
};
|
|
88
88
|
const handleInputChange = (event) => {
|
|
89
89
|
var _a;
|
|
90
|
-
// Only update internal value if the external "
|
|
90
|
+
// Only update internal value if the external "onInputChange" callback function is not defined
|
|
91
91
|
// as it will be used in a controlled way
|
|
92
92
|
if (onInputChange) {
|
|
93
93
|
// Use type assertion to access nativeEvent.data
|
|
94
94
|
const nativeEventData = (_a = event.nativeEvent) === null || _a === void 0 ? void 0 : _a.data;
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
95
|
+
// Whe "backspace" is used to remove a value, the nativeEventData is undefined. In this case
|
|
96
|
+
// we need to use the target value for the callback otherwise the user will not be able to
|
|
97
|
+
// remove a character from the input
|
|
98
|
+
const currentInputValue = event.target.value;
|
|
99
|
+
onInputChange(nativeEventData !== null && nativeEventData !== void 0 ? nativeEventData : currentInputValue, event.currentTarget.value);
|
|
98
100
|
return;
|
|
99
101
|
}
|
|
100
102
|
setInputValue(event.target.value);
|
|
@@ -89,14 +89,16 @@ const SaveableInput = (props) => {
|
|
|
89
89
|
};
|
|
90
90
|
const handleInputChange = (event) => {
|
|
91
91
|
var _a;
|
|
92
|
-
// Only update internal value if the external "
|
|
92
|
+
// Only update internal value if the external "onInputChange" callback function is not defined
|
|
93
93
|
// as it will be used in a controlled way
|
|
94
94
|
if (onInputChange) {
|
|
95
95
|
// Use type assertion to access nativeEvent.data
|
|
96
96
|
const nativeEventData = (_a = event.nativeEvent) === null || _a === void 0 ? void 0 : _a.data;
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
97
|
+
// Whe "backspace" is used to remove a value, the nativeEventData is undefined. In this case
|
|
98
|
+
// we need to use the target value for the callback otherwise the user will not be able to
|
|
99
|
+
// remove a character from the input
|
|
100
|
+
const currentInputValue = event.target.value;
|
|
101
|
+
onInputChange(nativeEventData !== null && nativeEventData !== void 0 ? nativeEventData : currentInputValue, event.currentTarget.value);
|
|
100
102
|
return;
|
|
101
103
|
}
|
|
102
104
|
setInputValue(event.target.value);
|
package/lib/es/version.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rio-cloud/rio-uikit",
|
|
3
|
-
"version": "0.16.4-beta.
|
|
3
|
+
"version": "0.16.4-beta.17",
|
|
4
4
|
"description": "The RIO UIKIT component library",
|
|
5
5
|
"repository": "https://collaboration.msi.audi.com/stash/projects/RIOFRONT/repos/uikit-web/browse",
|
|
6
6
|
"scripts": {
|
|
@@ -156,4 +156,4 @@
|
|
|
156
156
|
"Firefox ESR",
|
|
157
157
|
"not dead"
|
|
158
158
|
]
|
|
159
|
-
}
|
|
159
|
+
}
|
package/version.json
CHANGED