Skip to content

Allow selectionColor changing #19

@ftzi

Description

@ftzi

The TextInput is defined this way:

<TextInput
{...inputProps}
ref={inputRef}
style={styles.input}
pointerEvents={isFocused() ? 'auto' : 'none'}
onFocus={handleFocus}
onBlur={handleBlur}
onChangeText={handleChangeText}
maxLength={characterCount ? characterCount : undefined}
selectionColor={errorState() ? errorColor : activeColor}
placeholder=""
value={value}
/>

The selectionColor from the props are replaced by the errorColor : activeColor.

In my case, where the app color is yellow/orange, the selectionColor is too strong, where the border color is ok

image

I have commented for now the lib selectionColor, so I can change it by myself. My ideia is to have

selectionColor={selectionColor ? (typeof selectionColor === string ? selectionColor : selectionColor(errorState()) : (errorState() ? errorColor : activeColor)}

and the selectionColor would be just a string or (errorState: boolean) => string, a function where the dev can set the color of the selection if there is an error or not.

If you wish, I can implement it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions