uiowa / uids

UI Design System
http://uids.brand.uiowa.edu
7 stars 1 forks source link

Make click-a11y script callable by external script. #856

Closed pyrello closed 1 year ago

pyrello commented 1 year ago

Problem

As discovered in https://github.com/uiowa/uiowa/issues/6138, the click-a11y script we use for cards and banners is not written in a way that allows it to be called by another script. It is loaded and runs automatically right away. This doesn't work for AJAX though because the script never re-runs after it has first been loaded. To work with AJAX, the script should be callable so it can be triggered to run on AJAX responses as well.

Proposed solution

Refactor the click-a11y script to allow it to be called by another script.