question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Closing sidebar by clicking on the page

See original GitHub issue

Is there a way to close a sidebar by clicking on the page? The official semantic-ui supports this out of the box and is configurable via a closable setting.

Is there something I can use in this library to do it?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:11 (3 by maintainers)

github_iconTop GitHub Comments

10reactions
codeaidcommented, May 24, 2017

One easy solution I found while playing with layouts is to add an onClick event listener to the Sidebar.Pusher element:

<Sidebar.Pusher onClick={this.hideSidebar}>

I’ve not tested this extensively but seems to work well.

9reactions
FakhruddinAbdicommented, Oct 18, 2017

@levithomason any update about supporting closable props ?

Its really terrible solution to wrap whole application into pusher div just for a side bar.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Hide menu sidebar when clicking outside the bar or the button
Suppose if your sidebar width is 270px,check the mouse click coordinate.If it's greater give its style left attribute as -270px;
Read more >
The Sidebar has to be closed on clicking any part of screen
Hi. I have one sidebar which has form in it. The close option of the sidebar has to be performed in two ways....
Read more >
How To Create a Collapsed Sidebar - W3Schools
Click on the button to open the collapsible sidebar: ☰ Open Sidebar ... Position and style the close button (top right corner) */...
Read more >
Hide element when clicked outside using JavaScript
To hide an element when clicked outside, add a `click` event listener to the `document` object. On each click, check if the clicked...
Read more >
Sidebar / How To / Open and Close the Sidebar - Syncfusion
Open and Close the Sidebar in JavaScript Sidebar control · show() : Method to open the Sidebar. · hide() : Method to close...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found