xotahal / react-native-material-ui

Highly customizable material design components for React Native
MIT License
3.78k stars 609 forks source link

Left Icon is not displaying in Search bar when using custom image in left element (Toolbar). #448

Open Harikasai999 opened 5 years ago

Harikasai999 commented 5 years ago

Hi, i am using this module and all working fine. In Toolbar component i placed the custom image in left element. After i clicked search icon and typed any text in text-input then back icon is not displaying in Search bar. When i placed icon in left-element then back icon is displaying perfectly. Please give any suggestion for this issue. Here is my code:-

  onLeftIcon() {
    return (
      <View
        style={{
          alignItems: "center",
          justifyContent: "center"
          // backgroundColor: "green"
        }}
      >
        <Image
          source={require("../../Images/notification.png")}
          style={{ height: 20, width: 20, tintColor: "white" }}
        />
      </View>
    );
  }
  <Toolbar
          style={{
            container: { backgroundColor: "green" }
            // leftElement: { color: "white" }
          }}
          onLeftElementPress={() => {
            alert("dasssssjkfhd");
          }}
          leftElement={this.onLeftIcon()}
          centerElement="Searchable"
          searchable={{
            autoFocus: true,
            placeholder: "Search",
            onChangeText: text =>
              this.setState({
                text
              })
          }}
          rightElement="more-vert"
          onRightElementPress={() => {
            alert("djkfhd");
          }}
        />

Here is the screenshot:- ezgif com-video-to-gif

lixaotec commented 3 years ago

any updates? Workaround?

tks

SarvaDev-123 commented 3 years ago

@xotahal please update it.