Skip to content

Commit

Permalink
Merge pull request #6885 from matrix-org/t3chguy/fix/19030
Browse files Browse the repository at this point in the history
  • Loading branch information
t3chguy committed Sep 29, 2021
2 parents fbf74be + ad5842c commit c23e698
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/components/views/elements/Dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,14 @@ export default class Dropdown extends React.Component<IProps, IState> {
this.ignoreEvent = ev;
};

private onChevronClick = (ev: React.MouseEvent) => {
if (this.state.expanded) {
this.setState({ expanded: false });
ev.stopPropagation();
ev.preventDefault();
}
};

private onAccessibleButtonClick = (ev: ButtonEvent) => {
if (this.props.disabled) return;

Expand Down Expand Up @@ -375,7 +383,7 @@ export default class Dropdown extends React.Component<IProps, IState> {
onKeyDown={this.onKeyDown}
>
{ currentValue }
<span className="mx_Dropdown_arrow" />
<span onClick={this.onChevronClick} className="mx_Dropdown_arrow" />
{ menu }
</AccessibleButton>
</div>;
Expand Down

0 comments on commit c23e698

Please sign in to comment.