Skip to content

Commit cf4b20e

Browse files
author
Oskar Widmark
committed
fix: close side bar on clicking app bar
1 parent 304906a commit cf4b20e

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/App.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,7 @@ class App extends React.Component<Props> {
472472
toggleDisplaySettings={this.toggleDisplaySettings}
473473
shouldPlaySound={this.state.shouldPlaySound}
474474
togglePlaySound={this.togglePlaySound}
475+
onClick={this.closeDisplaySettings}
475476
/>
476477
<div
477478
className="canvas-wrapper"

src/AppBar.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,13 @@ interface AppBarProps {
2727
toggleDisplaySettings: () => void;
2828
shouldPlaySound: boolean;
2929
togglePlaySound: () => void;
30+
onClick: () => void;
3031
}
3132

3233
export function SortAppBar(props: AppBarProps) {
3334
return (
3435
<AppBar position="relative">
35-
<Toolbar className="toolbar">
36+
<Toolbar className="toolbar" onClick={props.onClick}>
3637
<div>
3738
<Button
3839
variant="contained"
@@ -126,7 +127,10 @@ export function SortAppBar(props: AppBarProps) {
126127
aria-label="open drawer"
127128
edge="end"
128129
className="open-drawer-button"
129-
onClick={props.toggleDisplaySettings}
130+
onClick={(e) => {
131+
e.stopPropagation();
132+
props.toggleDisplaySettings();
133+
}}
130134
>
131135
<MenuIcon />
132136
</IconButton>

0 commit comments

Comments
 (0)