Fix show filters

This commit is contained in:
Chen-I Lim 2020-10-14 17:38:57 -07:00
parent 3c9c5b6aea
commit 5c8d869307
2 changed files with 6 additions and 6 deletions

View file

@ -52,7 +52,7 @@ class Switch extends React.Component<Props, State> {
private async onClicked() {
const newIsOn = !this.state.isOn
await this.setState({ isOn: newIsOn })
this.setState({ isOn: newIsOn })
const { onChanged } = this.props

View file

@ -24,6 +24,7 @@ type State = {
workspaceTree: WorkspaceTree
boardTree?: BoardTree
shownCardTree?: CardTree
filterAnchorElement?: HTMLElement
}
export default class BoardPage extends React.Component<Props, State> {
@ -32,7 +33,6 @@ export default class BoardPage extends React.Component<Props, State> {
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<Props, State> {
}
}
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<Props, State> {
window.history.pushState({ path: newUrl }, "", newUrl)
}
showFilter(ahchorElement?: HTMLElement) {
this.filterAnchorElement = ahchorElement
showFilter(anchorElement?: HTMLElement) {
this.setState({...this.state, filterAnchorElement: anchorElement})
}
setSearchText(text?: string) {