diff --git a/package-lock.json b/package-lock.json index cebfda6b1..fd11c2da4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "1.1.0", + "version": "1.1.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "1.1.0", + "version": "1.1.1", "license": "ISC", "dependencies": { "@types/react-dates": "^21.8.6", diff --git a/package.json b/package.json index 106daa281..1a5e4de58 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "1.1.0", + "version": "1.1.1", "description": "Supporting common component library", "type": "module", "main": "dist/index.js", diff --git a/src/Common/CustomInput/CustomInput.tsx b/src/Common/CustomInput/CustomInput.tsx index 00c71316f..fdc0cbbad 100644 --- a/src/Common/CustomInput/CustomInput.tsx +++ b/src/Common/CustomInput/CustomInput.tsx @@ -69,9 +69,13 @@ export const CustomInput = ({ const handleOnBlur = (event) => { // NOTE: This is to prevent the input from being trimmed when the user do not want to trim the input if (!noTrim) { - event.stopPropagation() - event.target.value = event.target.value?.trim() - onChange(event) + const trimmedValue = event.target.value?.trim() + + if (event.target.value !== trimmedValue) { + event.stopPropagation() + event.target.value = trimmedValue + onChange(event) + } } if (typeof onBlur === 'function') { onBlur(event)