By styling the
aria
and
role
attributes directly and tying them to the JavaScript functionality you can enforce accessibility. This also reduces the need for custom class names and simplifies the JS.
Full credit to @_r_dhaliwal who helped spawn this idea