Mango/slideout

Move focus from button to first item in menu

Closed this issue · 1 comments

I can;t seem to find where/how the focus is being set back on the button and I need to set it on the first item in the menu for accessibility reasons. Can you point me in the right direction?

Hi @mrbrimm , you can use the translateend event to set focus on the first item:

slideout.on('translateend', function () {
  if (slideout.isOpen()) {
    document.querySelector('#example-first-item').focus();
  }
});