0

If I place the offcanvas toggle button close the offcanvas div, the trapkeyboard seems to work just fine, however, if I place the toggle in the header, and stick the offcanvas nav below the footer (it's fixed anyway and hidden so what does it matter) the trap keyboard no longer works. I thought this was odd that Bootstrap didn't keep track of the offcanvas trigger and push it into the focusable elements as the last item to be focused.

It does keep track in some way because when you use the escape key, it returns focus to the toggle btn. But if you do not have the toggle button close the the offcanvas nav, the trapkeyboard jumps right out of the offcanvas nav and back into the page behind it...

Anyone know a way around this issue? I was using js-offcanvas(https://github.com/vmitsaras/js-offcanvas), which has a trapkeyboard that works perfectly no matter where the button and nav are located... I just thought I'd give BS5's built in offcanvas a shot and ran into this issue... Thanks in advance.

Tony
  • 84
  • 1
  • 7

0 Answers0