mapbox / assembly

Making the hard parts of designing for the web easy.
https://www.mapbox.com/assembly/
134 stars 27 forks source link

Add API to toggle focus control #953

Closed samanpwbb closed 3 years ago

samanpwbb commented 3 years ago

Often I wish I could turn on focus hints even if user didn't press tab (for example, after some other user interaction where their focus state was important to highlight). Right now the only way to override the default behavior of focus control is with something like this:

document.documentElement &&
  document.documentElement.setAttribute('data-assembly-focus-control', 'visible');

Ideally, there's an assembly method I could call so I don't need to specify the element and attribute in my own code, like assembly.setFocusMode(boolean).