@devtron-labs/devtron-fe-common-lib 0.0.45-beta-11 → 0.0.45-beta-12
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.
package/dist/index.js
CHANGED
|
@@ -26637,12 +26637,12 @@ function CustomInput(_a) {
|
|
|
26637
26637
|
}
|
|
26638
26638
|
return error;
|
|
26639
26639
|
}
|
|
26640
|
-
var handleOnBlur = function (event) {
|
|
26640
|
+
var handleOnBlur = React.useCallback(function (event) {
|
|
26641
26641
|
onChange(__assign(__assign({}, event), { target: __assign(__assign({}, event.target), { value: event.target.value.trim() }) }));
|
|
26642
26642
|
if (typeof handleBlurChange === 'function') {
|
|
26643
|
-
handleBlurChange(
|
|
26643
|
+
handleBlurChange(event);
|
|
26644
26644
|
}
|
|
26645
|
-
};
|
|
26645
|
+
}, []);
|
|
26646
26646
|
var renderFormError = function () {
|
|
26647
26647
|
if ((error === null || error === void 0 ? void 0 : error.length) > 0) {
|
|
26648
26648
|
if (typeof error === 'object') {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CustomInputProps } from './Types'
|
|
2
2
|
import { ReactComponent as Info } from '../../Assets/Icon/ic-info-filled.svg'
|
|
3
3
|
import { ReactComponent as FormError } from '../../Assets/Icon/ic-warning.svg'
|
|
4
|
-
import {
|
|
4
|
+
import { useCallback } from 'react'
|
|
5
5
|
|
|
6
6
|
export function CustomInput({
|
|
7
7
|
name,
|
|
@@ -51,8 +51,7 @@ export function CustomInput({
|
|
|
51
51
|
return error
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
const handleOnBlur = (event) => {
|
|
55
|
-
|
|
54
|
+
const handleOnBlur = useCallback((event) => {
|
|
56
55
|
onChange({
|
|
57
56
|
...event,
|
|
58
57
|
target: {
|
|
@@ -61,16 +60,10 @@ export function CustomInput({
|
|
|
61
60
|
},
|
|
62
61
|
})
|
|
63
62
|
if (typeof handleBlurChange === 'function') {
|
|
64
|
-
handleBlurChange(
|
|
65
|
-
...event,
|
|
66
|
-
target: {
|
|
67
|
-
...event.target,
|
|
68
|
-
value: event.target.value.trim(),
|
|
69
|
-
},
|
|
70
|
-
})
|
|
63
|
+
handleBlurChange(event)
|
|
71
64
|
}
|
|
72
65
|
|
|
73
|
-
}
|
|
66
|
+
},[])
|
|
74
67
|
|
|
75
68
|
const renderFormError = () => {
|
|
76
69
|
if (error?.length > 0) {
|