app/javascript/blacklight/button_focus.js in blacklight-8.0.0.beta5 vs app/javascript/blacklight/button_focus.js in blacklight-8.0.0.beta6

- old
+ new

@@ -1,12 +1,12 @@ -const ButtonFocus = (() => { - document.addEventListener('click', (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() - } - }) -})() +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