@codeleap/web 3.18.1 → 3.18.2
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/package.json
CHANGED
|
@@ -52,9 +52,13 @@ export type TextInputProps =
|
|
|
52
52
|
hiddenIcon?: IconPlaceholder
|
|
53
53
|
} & ComponentVariants<typeof TextInputPresets>
|
|
54
54
|
|
|
55
|
-
type InputRef =
|
|
55
|
+
type InputRef = {
|
|
56
|
+
isTextInput?: boolean,
|
|
57
|
+
focus: () => void,
|
|
58
|
+
getInputRef: () => HTMLInputElement
|
|
59
|
+
}
|
|
56
60
|
|
|
57
|
-
const defaultProps:Partial<TextInputProps> = {
|
|
61
|
+
const defaultProps: Partial<TextInputProps> = {
|
|
58
62
|
hiddenIcon: 'input-visiblity:hidden' as IconPlaceholder,
|
|
59
63
|
visibleIcon: 'input-visiblity:visible' as IconPlaceholder,
|
|
60
64
|
}
|
|
@@ -111,11 +115,13 @@ export const TextInputComponent = forwardRef<InputRef, TextInputProps>((props, i
|
|
|
111
115
|
|
|
112
116
|
useImperativeHandle(inputRef, () => {
|
|
113
117
|
return {
|
|
114
|
-
...innerInputRef.current,
|
|
115
118
|
focus: () => {
|
|
116
119
|
innerInputRef.current?.focus?.()
|
|
117
120
|
},
|
|
118
121
|
isTextInput: true,
|
|
122
|
+
getInputRef: () => {
|
|
123
|
+
return innerInputRef.current
|
|
124
|
+
},
|
|
119
125
|
}
|
|
120
126
|
}, [!!innerInputRef?.current?.focus])
|
|
121
127
|
|