harvard-lil / perma

Indelible links
411 stars 70 forks source link

Fix arrow navigation behavior of custom select #3558

Closed tinykite closed 2 weeks ago

tinykite commented 2 weeks ago

What this does

While working on an unrelated feature for Perma, I noticed that the behavior of the custom select, that allows users to choose a destination for their next Perma capture, had a bug.

Users could select any option just fine using a mouse, but attempting to navigate past the first option in the list of select options using the down arrow threw a console error. This likely happened when the custom select was slightly refactored — and folders began being passed to the component as a prop rather than being managed internally as a reactive ref.

Reference Screenshot

image

How to test

Additional notes

After fixing this, I double-checked that other keyboard behaviors still worked as expected as well:

codecov[bot] commented 2 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 68.94%. Comparing base (a8a09c3) to head (0d7d9a5). Report is 16 commits behind head on develop.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #3558 +/- ## ======================================== Coverage 68.94% 68.94% ======================================== Files 48 48 Lines 6900 6900 ======================================== Hits 4757 4757 Misses 2143 2143 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.