title: Material UI ClickAwayListener close when clicking itself
body: <p>I have the below display sidebar Switch that shows up within a Popper. So, Ideally, if you click elsewhere (outside of the Popper element), Popper should disappear. If you click inside Popper element, it should not go anywhere. When I click on the Switch or Display Sidebar text, that Popper goes away. I wrapped the Popper with <code>&lt;div&gt;</code> it didn't help either.</p>
  
  <p>Popper <a href="https://material-ui.com/api/popper/" rel="noreferrer">https://material-ui.com/api/popper/</a></p>
  
  <p>Switch <a href="https://material-ui.com/api/switch/" rel="noreferrer">https://material-ui.com/api/switch/</a></p>
  
  <p>ClickAwayListener <a href="https://material-ui.com/utils/click-away-listener/" rel="noreferrer">https://material-ui.com/utils/click-away-listener/</a></p>
  
  <p>Below is the Popper Code</p>
  
  <pre><code>&lt;ClickAwayListener onClickAway={this.handleClickAway}&gt;
        &lt;div&gt;
          &lt;Popper className={classes.popper} id={id} open={open} placement="bottom-end" anchorEl={anchorEl} transition&gt;
            {({ TransitionProps }) =&gt; (
              &lt;Fade {...TransitionProps} timeout={350}&gt;
                &lt;Paper className={classes.SliderBox}&gt;
                  &lt;Switch
                    checked={this.state.checkedB}
                    onChange={this.handleChange('checkedB')}
                    value="checkedB"
                    color="primary"
                    onClick={handleDrawer}
                    className={classNames(classes.menuButton, sidebar &amp;&amp; classes.hide)}
                  /&gt;
                  Display Sidebar
                &lt;/Paper&gt;
              &lt;/Fade&gt;
            )}
          &lt;/Popper&gt;
          &lt;/div&gt;
         &lt;/ClickAwayListener&gt;
  </code></pre>
  
  <p>I have the sample here (though I couldn't get it work I don't know why it gives error on clickaway)
  <a href="https://codesandbox.io/s/8pkm3x1902" rel="noreferrer">https://codesandbox.io/s/8pkm3x1902</a></p>
  
  <p><a href="https://i.stack.imgur.com/CzfDI.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/CzfDI.jpg" alt="enter image description here"></a></p>