Skip to content

Commit b619087

Browse files
committed
refactor: CustomInput - handleOnBlur -> onBlur rename
1 parent a776590 commit b619087

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/Common/CustomInput/CustomInput.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export const CustomInput = ({
3737
rootClassName = '',
3838
autoComplete = 'off',
3939
helperText = '',
40-
handleOnBlur,
40+
onBlur,
4141
readOnly = false,
4242
noTrim = false,
4343
onKeyPress,
@@ -66,15 +66,15 @@ export const CustomInput = ({
6666
return error
6767
}
6868

69-
const onBlur = (event) => {
69+
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) {
7272
event.stopPropagation()
7373
event.target.value = event.target.value?.trim()
7474
onChange(event)
7575
}
76-
if (typeof handleOnBlur === 'function') {
77-
handleOnBlur(event)
76+
if (typeof onBlur === 'function') {
77+
onBlur(event)
7878
}
7979
}
8080

@@ -127,7 +127,7 @@ export const CustomInput = ({
127127
e.persist()
128128
onChange(e)
129129
}}
130-
onBlur={onBlur}
130+
onBlur={handleOnBlur}
131131
onFocus={onFocus}
132132
placeholder={placeholder}
133133
value={value}

src/Common/CustomInput/Types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export interface CustomInputProps {
3434
rootClassName?: string
3535
error?: string[] | string
3636
helperText?: ReactNode
37-
handleOnBlur?: (e) => void
37+
onBlur?: (e) => void
3838
readOnly?: boolean
3939
noTrim?: boolean
4040
onKeyPress?: (e) => void

0 commit comments

Comments
 (0)