1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-10-31 00:07:48 +02:00

Mobile: Prevent search box from being cleared when updated from somewhere else

This commit is contained in:
Laurent Cozic
2019-01-19 18:40:21 +00:00
parent 4847fd76de
commit cc91c77f9e

View File

@@ -73,7 +73,7 @@ class SearchScreenComponent extends BaseScreenComponent {
UNSAFE_componentWillReceiveProps(newProps) {
let newState = {};
if ('query' in newProps) newState.query = newProps.query;
if ('query' in newProps && !this.state.query) newState.query = newProps.query;
if (Object.getOwnPropertyNames(newState).length) {
this.setState(newState);