Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

color prop in TextInput.Icon does not work #3901

Closed
cjmling opened this issue May 21, 2023 · 1 comment · Fixed by #3907
Closed

color prop in TextInput.Icon does not work #3901

cjmling opened this issue May 21, 2023 · 1 comment · Fixed by #3907
Assignees

Comments

@cjmling
Copy link

cjmling commented May 21, 2023

Current behaviour

The color prop in TextInput.Icon https://callstack.github.io/react-native-paper/docs/components/TextInput/TextInputIcon suppose to change icon color but at present it doesn't work. But undocumented iconColor does work and change the icon color

Expected behaviour

It should change the icon color

How to reproduce?

Navigate to TextInput example. I have update the code. Check the top 2 example.

https://snack.expo.dev/@cjmling/react-native-paper-example_v5

     <TextInput
            style={styles.inputContainerStyle}
            label="color prop does not work"
            placeholder="Type something"
            value={text}
            onChangeText={(text) => inputActionHandler('text', text)}
            left={
              <TextInput.Icon
                icon="magnify"
                color={'#22C55E'}
                onPress={() => {
                  changeIconColor('flatLeftIcon');
                }}
              />
            }
            right={<TextInput.Affix text="/100" />}
          />
          <TextInput
            style={styles.inputContainerStyle}
            label="iconColor work"
            placeholder="Type something"
            value={text}
            onChangeText={(text) => inputActionHandler('text', text)}
            left={
              <TextInput.Icon
                icon="magnify"
                iconColor="#22C55E"
                onPress={() => {
                  changeIconColor('flatLeftIcon');
                }}
              />
            }
            right={<TextInput.Affix text="/100" />}
          />

Preview

image

What have you tried so far?

Your Environment

software version
ios x
android x
react-native x.x.x
react-native-paper 5.7.0
node x.x.x
npm or yarn x.x.x
expo sdk x.x.x
@Nensi9
Copy link

Nensi9 commented Jun 8, 2023

The color prop in TextInput.Icon not working

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants