diff --git a/src/client/components/switch.tsx b/src/client/components/switch.tsx index 281c936c0..3354e239d 100644 --- a/src/client/components/switch.tsx +++ b/src/client/components/switch.tsx @@ -52,7 +52,7 @@ class Switch extends React.Component { private async onClicked() { const newIsOn = !this.state.isOn - await this.setState({ isOn: newIsOn }) + this.setState({ isOn: newIsOn }) const { onChanged } = this.props diff --git a/src/client/pages/boardPage.tsx b/src/client/pages/boardPage.tsx index ca2da0502..f824cdc2a 100644 --- a/src/client/pages/boardPage.tsx +++ b/src/client/pages/boardPage.tsx @@ -24,6 +24,7 @@ type State = { workspaceTree: WorkspaceTree boardTree?: BoardTree shownCardTree?: CardTree + filterAnchorElement?: HTMLElement } export default class BoardPage extends React.Component { @@ -32,7 +33,6 @@ export default class BoardPage extends React.Component { updateTitleTimeout: number updatePropertyLabelTimeout: number - private filterAnchorElement?: HTMLElement private octo = new OctoClient() private boardListener = new OctoListener() private cardListener = new OctoListener() @@ -126,8 +126,8 @@ export default class BoardPage extends React.Component { } } - if (this.filterAnchorElement) { - const element = this.filterAnchorElement + if (this.state.filterAnchorElement) { + const element = this.state.filterAnchorElement const bodyRect = document.body.getBoundingClientRect() const rect = element.getBoundingClientRect() // Show at bottom-left of element @@ -246,8 +246,8 @@ export default class BoardPage extends React.Component { window.history.pushState({ path: newUrl }, "", newUrl) } - showFilter(ahchorElement?: HTMLElement) { - this.filterAnchorElement = ahchorElement + showFilter(anchorElement?: HTMLElement) { + this.setState({...this.state, filterAnchorElement: anchorElement}) } setSearchText(text?: string) {