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

Searchbar crashes on Android when wrapped in Appbar #605

Closed
bunea opened this issue Oct 16, 2018 · 5 comments · Fixed by #972
Closed

Searchbar crashes on Android when wrapped in Appbar #605

bunea opened this issue Oct 16, 2018 · 5 comments · Fixed by #972

Comments

@bunea
Copy link

bunea commented Oct 16, 2018

Current behaviour

Searchbar component crashes on Android with
Error while updating property 'color' in shadow node of type: AndroidTextInput
when it's wrapped in Appbar or Appbar.Header. I guess this happens because Appbar changes the theme based on the dark property. This works fine on iOS.

Expected behaviour

Should not crash.

Code sample

class SearchContainer extends React.Component {
    render() {
        return (
            <Appbar.Header>
                <Searchbar
                    value=""
                />
            </Appbar.Header>
        )
    }
}

It seems to happen because of this and this. ...rest contains color prop, which crashes the TextInput.

Your Environment

software version
ios or android android 28
react-native 0.57.1
react-native-paper 2.1.3
node 10.11.0
npm or yarn 1.10.1
@Trancever
Copy link
Contributor

@bunea Please wrap Searchbar with additional View as a workaround:

            <Appbar.Header>
              <View style={{ flex: 1 }}>
                <Searchbar
                    value=""
                />
              </View>
            </Appbar.Header>

@satya164
Copy link
Member

@satya164 satya164 reopened this Oct 23, 2018
brunohkbx added a commit to brunohkbx/react-native-paper that referenced this issue Apr 3, 2019
It crashes TextInput on android devices when color prop is passed.

Fix callstack#605
brunohkbx added a commit to brunohkbx/react-native-paper that referenced this issue Apr 3, 2019
It crashes TextInput on android devices when color prop is passed.

Fix callstack#605
brunohkbx added a commit to brunohkbx/react-native-paper that referenced this issue Apr 3, 2019
It crashes TextInput on android devices when color prop is passed.

Fix callstack#605
brunohkbx added a commit to brunohkbx/react-native-paper that referenced this issue Apr 4, 2019
It crashes TextInput on android devices when color prop is passed.

Fix callstack#605
@jayu jayu closed this as completed in #972 Apr 16, 2019
@whoisdevd
Copy link

I'm still facing the same issue. Tried yarn upgrade react-native-paper to get the latest fix you merged but still crashes on Android. Is there any other way to get the latest source or am I missing something here?

Thanks

@whoisdevd
Copy link

On a side note, wrapping it inside a view fixes the problem though. It'd better if we could avoid nesting.

@jayu
Copy link
Contributor

jayu commented Apr 23, 2019

@devdebajyotidas This merge is not released yet. In a few days, we should release recent changes.

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.

6 participants