azinasili/a11yoffcanvas

Drawer not opening if button contains svg icon

Opened this issue · 0 comments

5ulo commented

When the button contains a svg icon the click event is fired, so does function open() but it depends on where inside the button you clicked. If the click was on text or button padding, the drawer opens. If the click was somewhere over the svg icon, the drawer wont open.

<button type="button" class="btn" data-a11yoffcanvas-trigger="drawerRight">
  <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-list" viewBox="0 0 16 16">
    <path fill-rule="evenodd" d="M2.5 12a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5m0-4a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5m0-4a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5"/>
  </svg>
</button>

codepen https://codepen.io/5ulo/pen/RwOagmV