diff --git a/src/TextInput/index.tsx b/src/TextInput/index.tsx index 0738198..7d0e664 100644 --- a/src/TextInput/index.tsx +++ b/src/TextInput/index.tsx @@ -42,6 +42,7 @@ const TextInputComponent: InputProps = (props) => { numeric, textError, focusColor, + selectionColor, onFocus, onBlur, onChangeText = (_value: string) => {}, @@ -176,6 +177,18 @@ const TextInputComponent: InputProps = (props) => { } }, [isFocus, text.length, label, focusColor, labelStyle, placeholderStyle]); + const stylePlaceholder: StyleProp = useMemo(() => { + if (!isFocus || (text.length <=0 && placeholder)) { + const style: any = placeholderStyle; + return { + position: 'absolute', + ...style, + }; + } else { + return; + } + }, [isFocus, text.length, placeholder]); + return ( <> @@ -188,10 +201,11 @@ const TextInputComponent: InputProps = (props) => { ) => void; onBlur?: (e: NativeSyntheticEvent) => void; renderRightIcon?: () => JSX.Element | null | undefined;