question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Searchbar crashes on Android when wrapped in Appbar

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Trancevercommented, Oct 23, 2018

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

            <Appbar.Header>
              <View style={{ flex: 1 }}>
                <Searchbar
                    value=""
                />
              </View>
            </Appbar.Header>
0reactions
jayucommented, Apr 23, 2019

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

App crashes after adding search widget on appbar
1 Answer 1 · Actually, I don't want all activities to provide a search dialog just the SearchActivity. · So try to put...
Read more >
How do I fix the fact that my google search bar crashes every ...
Hi Jason, no it crashes as soon as you hit search. Sometimes some searches start to show then crash but most of the...
Read more >
D.P.F Delphi iOS Native Components - Browse /v7.x at SourceForge ...
BarTintColor property + Added TDPFSearchBar.MaxLength property - Fixed TMFMessageComposeViewController crash on send message - Fixed set TDPFSearchBar.
Read more >
Top Flutter Search Bar, Search APIs and Utilities packages
The complete list of Dart and Flutter packages that can help you build Search Bar, Search Box or App Bar Search, and provide...
Read more >
Change navigation bar height swift 4 - Seba Online
0 Search Bar In Navigation Bar - Custom Navigation View - SwiftUI Tutorials. ... and width of the Android Navigation Bar programmatically using...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found