mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-24 10:27:10 +02:00
Mobile: Fixed search screen
This commit is contained in:
parent
cf427eba0f
commit
a2156be4ec
@ -79,8 +79,8 @@ function addExtraStyles(style) {
|
||||
};
|
||||
|
||||
if (Platform.OS === 'ios') {
|
||||
style.lineInput.borderBottomWidth = 1;
|
||||
style.lineInput.borderBottomColor = style.dividerColor;
|
||||
delete style.lineInput.borderBottomWidth;
|
||||
delete style.lineInput.borderColor;
|
||||
}
|
||||
|
||||
style.buttonRow = {
|
||||
|
@ -71,15 +71,17 @@ class SearchScreenComponent extends BaseScreenComponent {
|
||||
this.isMounted_ = false;
|
||||
}
|
||||
|
||||
UNSAFE_componentWillReceiveProps(newProps) {
|
||||
let newState = {};
|
||||
if ('query' in newProps && !this.state.query) newState.query = newProps.query;
|
||||
// UNSAFE_componentWillReceiveProps(newProps) {
|
||||
// console.info('UNSAFE_componentWillReceiveProps', newProps);
|
||||
|
||||
if (Object.getOwnPropertyNames(newState).length) {
|
||||
this.setState(newState);
|
||||
this.refreshSearch(newState.query);
|
||||
}
|
||||
}
|
||||
// let newState = {};
|
||||
// if ('query' in newProps && !this.state.query) newState.query = newProps.query;
|
||||
|
||||
// if (Object.getOwnPropertyNames(newState).length) {
|
||||
// this.setState(newState);
|
||||
// this.refreshSearch(newState.query);
|
||||
// }
|
||||
// }
|
||||
|
||||
searchTextInput_submit() {
|
||||
const query = this.state.query.trim();
|
||||
@ -89,6 +91,9 @@ class SearchScreenComponent extends BaseScreenComponent {
|
||||
type: 'SEARCH_QUERY',
|
||||
query: query,
|
||||
});
|
||||
|
||||
this.setState({ query: query });
|
||||
this.refreshSearch(query);
|
||||
}
|
||||
|
||||
clearButton_press() {
|
||||
@ -96,6 +101,9 @@ class SearchScreenComponent extends BaseScreenComponent {
|
||||
type: 'SEARCH_QUERY',
|
||||
query: '',
|
||||
});
|
||||
|
||||
this.setState({ query: '' });
|
||||
this.refreshSearch('');
|
||||
}
|
||||
|
||||
async refreshSearch(query = null) {
|
||||
|
Loading…
Reference in New Issue
Block a user