From c8ebb7caafb098542a55ac725231041bf4e5d684 Mon Sep 17 00:00:00 2001 From: Michel Weststrate Date: Fri, 17 Jan 2020 06:28:38 -0800 Subject: [PATCH] Fix layout of clear icon Summary: Flipper clear icon was hidden, this fixes it Also fixed a null pointer exception that would occur when clearing search with the keyboard, and no filters were active Reviewed By: passy Differential Revision: D19445833 fbshipit-source-id: 213c28dc8c1e295018e6318f86604d96d2a9b75c --- src/ui/components/searchable/Searchable.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/ui/components/searchable/Searchable.tsx b/src/ui/components/searchable/Searchable.tsx index 8b58063db..d0544f3d1 100644 --- a/src/ui/components/searchable/Searchable.tsx +++ b/src/ui/components/searchable/Searchable.tsx @@ -291,6 +291,7 @@ const Searchable = ( this.state.focusedToken === -1 && this.state.searchTerm === '' && this._inputRef && + lastFilter && (lastFilter.type !== 'enum' || !lastFilter.persistent) ) { this._inputRef.blur(); @@ -483,6 +484,9 @@ const Searchable = ( } regex={Boolean(this.state.regexEnabled && this.state.searchTerm)} /> + {(this.state.searchTerm || this.state.filters.length > 0) && ( + × + )} {this.props.allowRegexSearch ? ( ) : null} - {(this.state.searchTerm || this.state.filters.length > 0) && ( - × - )} {actions != null && {actions}} ,