Skip to content

Commit

Permalink
fix(component): responsive sidebar now closes on backdrop and menu cl…
Browse files Browse the repository at this point in the history
…ick (#121)

The responsive sidebar initially closes only when the close icon is clicked but now closes once the
backdrop is clicked as well as any item on the menu.
  • Loading branch information
Annysah authored Jun 24, 2021
1 parent 0b92efc commit f2ebca7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/cms/pages/Dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ const Dashboard: React.FC<DashboardProps> = () => {
className="fixed inset-0"
aria-hidden={!offCanvasOpen}
>
<div className="absolute inset-0 bg-gray-600 opacity-75" />
<div className="absolute inset-0 bg-gray-600 opacity-75"
onClick={() =>setOffCanvasOpen(!offCanvasOpen)}
/>
</div>
)}
</Transition.Child>
Expand Down Expand Up @@ -90,7 +92,7 @@ const Dashboard: React.FC<DashboardProps> = () => {
/>
</div>
</div>
<div className="mt-5 flex-1 h-0 overflow-y-auto">
<div className="mt-5 flex-1 h-0 overflow-y-auto" onClick={() =>setOffCanvasOpen(!offCanvasOpen)}>
<Nav className="md:px-2 space-y-1" />
</div>
</div>
Expand Down

0 comments on commit f2ebca7

Please sign in to comment.