fecgov / fec-cms

The content management system (CMS) for the new Federal Election Commission website.
https://www.fec.gov
Other
96 stars 39 forks source link

Pres Map - Raising exports accordion toggle does not work as expected #4558

Open johnnyporkchops opened 3 years ago

johnnyporkchops commented 3 years ago

Summary

In the final iteration of the changes to pres-finance-map-box.js for https://github.com/fecgov/fec-cms/pull/4504, a breaking change was overlooked in testing : The open/close behavior of Export raising data area.

What happened? User clicks Export raising data button to open downloads area and page scrolls to its location.

What should have happened? This area should remain toggleable, once it is open by clicking the Export raising data button and maintain the user-chosen state (open/closed) while scrolling around

Frequency

Always

How to Reproduce

Device, browser, etc

Chrome/Opera/Firefox/Safari Will need to test in MS Edge as we did for the passive listeners PR #4504 that introduced this and since passive listeners involve touchstart and scroll events, it is a good idea to test touch screen on MS Surface and Phones.

Possible solutions to consider: 1) Figure out how to maintain the original functionality while also achieving the passive listeners fix (look at previous iteration before passive listener PR 4504) 2) Remove the ability to close the area once it has been opened by user clicking Export raising data button (with UX approval) 3) Use the out-of-the-box accordion that we use on other pages, although I believe attempts at this were difficult the first time around, hence the current one-off html/js implementation.

Comment on the issue on post-merged PR https://github.com/fecgov/fec-cms/pull/4504/files#r615523787

johnnyporkchops commented 11 months ago

The new scroll listener/function causes the height on the state-downloads links area to continue to calculate long after the scroll has stopped. This blocks the accordion toggle function from working until it finally finishes registering a value for every pixel the user scrolled.

pres_mapA