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.
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.