Skip to content

Commit eac7dd9

Browse files
committed
Merge branch 'develop' of https://github.com/devtron-labs/devtron-fe-common-lib into feat/marked-version-bump
2 parents 9c7dc14 + ee068a0 commit eac7dd9

File tree

4 files changed

+13
-6
lines changed

4 files changed

+13
-6
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@devtron-labs/devtron-fe-common-lib",
3-
"version": "1.0.9",
3+
"version": "1.0.11",
44
"description": "Supporting common component library",
55
"type": "module",
66
"main": "dist/index.js",

src/Common/CustomInput/CustomInput.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,13 @@ export const CustomInput = ({
6969
const handleOnBlur = (event) => {
7070
// NOTE: This is to prevent the input from being trimmed when the user do not want to trim the input
7171
if (!noTrim) {
72-
event.stopPropagation()
73-
event.target.value = event.target.value?.trim()
74-
onChange(event)
72+
const trimmedValue = event.target.value?.trim()
73+
74+
if (event.target.value !== trimmedValue) {
75+
event.stopPropagation()
76+
event.target.value = trimmedValue
77+
onChange(event)
78+
}
7579
}
7680
if (typeof onBlur === 'function') {
7781
onBlur(event)

src/Common/Hooks/useUrlFilters/useUrlFilters.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,9 @@ const useUrlFilters = <T = string, K = unknown>({
161161
}
162162

163163
useEffect(() => {
164+
if (!localStorageKey) {
165+
return
166+
}
164167
// if we have search string, set secondary params in local storage accordingly
165168
if (location.search) {
166169
setItemInLocalStorageIfKeyExists(localStorageKey, JSON.stringify(parsedParams))

0 commit comments

Comments
 (0)