From c98ae89b505d5069a244728397a72fa2fe63bd32 Mon Sep 17 00:00:00 2001 From: Chen-I Lim Date: Thu, 8 Oct 2020 20:20:02 -0700 Subject: [PATCH] Search --- src/client/components/boardComponent.tsx | 9 +++++++-- src/client/components/editable.tsx | 1 - 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/client/components/boardComponent.tsx b/src/client/components/boardComponent.tsx index ef1fca990..c6f41de65 100644 --- a/src/client/components/boardComponent.tsx +++ b/src/client/components/boardComponent.tsx @@ -101,7 +101,12 @@ class BoardComponent extends React.Component {
{ this.filterClicked(e) }}>Filter
{ this.sortClicked(e) }}>Sort
{this.state.isSearching - ? { this.searchChanged(text) }} onKeyDown={(e) => { this.onSearchKeyDown(e) }}> + ? { this.searchChanged(text) }} + onKeyDown={(e) => { this.onSearchKeyDown(e) }}> :
{ this.setState({ ...this.state, isSearching: true }) }}>Search
}
{ this.optionsClicked(e) }}>
@@ -398,7 +403,7 @@ class BoardComponent extends React.Component { onSearchKeyDown(e: React.KeyboardEvent) { if (e.keyCode === 27) { // ESC: Clear search this.searchFieldRef.current.text = "" - this.setState({...this.state, isSearching: false}) + this.setState({ ...this.state, isSearching: false }) this.props.pageController.setSearchText(undefined) e.preventDefault() } diff --git a/src/client/components/editable.tsx b/src/client/components/editable.tsx index 5b7b1e028..0c388ff55 100644 --- a/src/client/components/editable.tsx +++ b/src/client/components/editable.tsx @@ -102,7 +102,6 @@ class Editable extends React.Component { this.text = newText this.elementRef.current.classList.remove("active") - if (onBlur) { onBlur() } }}