Skip to content

Commit b49f7e6

Browse files
committed
always show the search icon on android
1 parent 77b34cb commit b49f7e6

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

source/views/components/searchbar/index.android.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ export class SearchBar extends React.Component<Props> {
2828
static defaultProps = {
2929
active: false,
3030
backButtonAndroid: true,
31+
androidIcon: null,
3132
onCancel: () => {},
3233
onChange: () => {},
3334
onFocus: () => {},
@@ -41,17 +42,18 @@ export class SearchBar extends React.Component<Props> {
4142
}
4243

4344
render() {
45+
let {backButtonAndroid} = this.props
4446
let backButton = this.props.active ? backIcon : searchIcon
4547

4648
return (
4749
<NativeSearchBar
4850
ref={this.handleRef}
4951
autoCorrect={false}
50-
backButton={backButton}
52+
backButton={backButtonAndroid === 'search' ? searchIcon : backButton}
5153
closeButton={this.props.active ? closeIcon : null}
5254
focusOnLayout={false}
5355
handleChangeText={this.props.onChange}
54-
hideBack={!this.props.backButtonAndroid}
56+
hideBack={!backButtonAndroid}
5557
hideClose={!this.props.active}
5658
input={this.props.value}
5759
onBack={this.props.onCancel}

source/views/components/searchbar/types.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
export type Props = {
44
getRef?: any,
55
active?: boolean,
6-
backButtonAndroid?: boolean,
6+
backButtonAndroid?: "search" | boolean,
77
backgroundColor?: string,
88
onCancel: () => any,
99
onChange: string => any,

source/views/sis/components/animated-searchbox.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ export class AnimatedSearchbox extends React.Component<Props> {
118118
<Animated.View style={searchStyle}>
119119
<SearchBar
120120
active={this.props.active}
121-
backButtonAndroid={false}
121+
backButtonAndroid="search"
122122
onCancel={this.handleCancel}
123123
onChange={this.props.onChange}
124124
onFocus={this.handleFocus}

0 commit comments

Comments
 (0)