Force click on item to switch

This commit is contained in:
tidy-dev 2022-09-13 09:36:35 -04:00
parent bf823d2b3f
commit 1c0e0914f6

View file

@ -76,14 +76,10 @@ export class BranchSelect extends React.Component<
private onItemClick = (branch: Branch, source: ClickSource) => {
source.event.preventDefault()
this.setState({ showBranchDropdown: false })
this.setState({ showBranchDropdown: false, selectedBranch: branch })
this.props.onChange?.(branch)
}
private onSelectionChanged = async (selectedBranch: Branch | null) => {
this.setState({ selectedBranch })
}
private onFilterTextChanged = (filterText: string) => {
this.setState({ filterText })
}
@ -112,7 +108,6 @@ export class BranchSelect extends React.Component<
filterText={filterText}
onFilterTextChanged={this.onFilterTextChanged}
selectedBranch={selectedBranch}
onSelectionChanged={this.onSelectionChanged}
canCreateNewBranch={false}
renderBranch={this.renderBranch}
onItemClick={this.onItemClick}