Sha256: f1b6d0d3feed51636c333c762e77403f3891dfd3f66f3bdd3c3e6f6179ae2bff

Contents?: true

Size: 466 Bytes

Versions: 16

Compression:

Stored size: 466 Bytes

Contents

const ButtonFocus = (e) => {
  // Button clicks should change focus. As of 10/3/19, Firefox for Mac and
  // Safari both do not set focus to a button on button click.
  // See https://zellwk.com/blog/inconsistent-button-behavior/ for background information
  if (e.target.matches('[data-toggle="collapse"]') || e.target.matches('[data-bs-toggle="collapse"]')) {
    e.target.focus()
  }
}

document.addEventListener('click', ButtonFocus)

export default ButtonFocus

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
blacklight-8.6.1 app/javascript/blacklight/button_focus.js
blacklight-8.6.0 app/javascript/blacklight/button_focus.js
blacklight-8.5.1 app/javascript/blacklight/button_focus.js
blacklight-8.5.0 app/javascript/blacklight/button_focus.js
blacklight-8.4.0 app/javascript/blacklight/button_focus.js
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/blacklight-8.3.0/app/javascript/blacklight/button_focus.js
blacklight-8.3.0 app/javascript/blacklight/button_focus.js
blacklight-8.2.2 app/javascript/blacklight/button_focus.js
blacklight-8.2.1 app/javascript/blacklight/button_focus.js
blacklight-8.2.0 app/javascript/blacklight/button_focus.js
blacklight-8.1.0 app/javascript/blacklight/button_focus.js
blacklight-8.0.1 app/javascript/blacklight/button_focus.js
blacklight-8.0.0 app/javascript/blacklight/button_focus.js
blacklight-8.0.0.beta8 app/javascript/blacklight/button_focus.js
blacklight-8.0.0.beta7 app/javascript/blacklight/button_focus.js
blacklight-8.0.0.beta6 app/javascript/blacklight/button_focus.js