uchicago-library / library_website

The University of Chicago Library Website
5 stars 5 forks source link

Radio buttons on homepage search box #436

Open dbietila opened 3 years ago

dbietila commented 3 years ago

Under certain conditions, the radio button selection in the "Articles, Journals & Databases" tab of the search box does not match the search type shown.

A way to reach this state is to do the following:

In some browsers, it will show the search form for Articles Plus, but the radio button for "Journals" will still be selected. This behavior has been observed in Win/Chrome, Win/Edge, and Lin/Chromium.

bbusenius commented 3 years ago

I've done some initial investigation on this. I'm adding the following notes for my memory:

It looks like the url # in the address bar isn't updating when the tabs are clicked. This isn't exactly causing the problem, however, when the # is present, the browser back button performs more consistently, e.g. https://www.lib.uchicago.edu//#tab-2. It's possible that the google analytics script is causing this, I'm not sure. Nevertheless, the wrong radio button is still checked when using the back button in this scenario, even though the correct tab might be open.

It looks like the checked attributes on radio button inputs are not being updated when the radio buttons are toggled. I believe these should be changing.

Related files