Mobile: Fixed search screen

pull/1185/head
Laurent Cozic 2019-02-03 16:57:29 +00:00
parent cf427eba0f
commit a2156be4ec
2 changed files with 18 additions and 10 deletions

View File

@ -79,8 +79,8 @@ function addExtraStyles(style) {
}; };
if (Platform.OS === 'ios') { if (Platform.OS === 'ios') {
style.lineInput.borderBottomWidth = 1; delete style.lineInput.borderBottomWidth;
style.lineInput.borderBottomColor = style.dividerColor; delete style.lineInput.borderColor;
} }
style.buttonRow = { style.buttonRow = {

View File

@ -71,15 +71,17 @@ class SearchScreenComponent extends BaseScreenComponent {
this.isMounted_ = false; this.isMounted_ = false;
} }
UNSAFE_componentWillReceiveProps(newProps) { // UNSAFE_componentWillReceiveProps(newProps) {
let newState = {}; // console.info('UNSAFE_componentWillReceiveProps', newProps);
if ('query' in newProps && !this.state.query) newState.query = newProps.query;
if (Object.getOwnPropertyNames(newState).length) { // let newState = {};
this.setState(newState); // if ('query' in newProps && !this.state.query) newState.query = newProps.query;
this.refreshSearch(newState.query);
} // if (Object.getOwnPropertyNames(newState).length) {
} // this.setState(newState);
// this.refreshSearch(newState.query);
// }
// }
searchTextInput_submit() { searchTextInput_submit() {
const query = this.state.query.trim(); const query = this.state.query.trim();
@ -89,6 +91,9 @@ class SearchScreenComponent extends BaseScreenComponent {
type: 'SEARCH_QUERY', type: 'SEARCH_QUERY',
query: query, query: query,
}); });
this.setState({ query: query });
this.refreshSearch(query);
} }
clearButton_press() { clearButton_press() {
@ -96,6 +101,9 @@ class SearchScreenComponent extends BaseScreenComponent {
type: 'SEARCH_QUERY', type: 'SEARCH_QUERY',
query: '', query: '',
}); });
this.setState({ query: '' });
this.refreshSearch('');
} }
async refreshSearch(query = null) { async refreshSearch(query = null) {