select icon indicating copy to clipboard operation
select copied to clipboard

fix: Pressing up with all options disabled underflowing

Open nathan-knight opened this issue 3 years ago • 2 comments

Previously if you had a select with all options disabled, pressing up arrow would make current < 0 so memoFlattenOptions[current] would be undefined. Multiplying len by 2 is an easy way to make sure it wraps around gracefully.

nathan-knight avatar Jan 21 '22 17:01 nathan-knight

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/react-component/select/DWYKAXc2fHeuGXXK5B7gvxHPQJLy
✅ Preview: https://select-git-fork-nathan-knight-fix-option-51dae0-react-component.vercel.app

vercel[bot] avatar Jan 21 '22 17:01 vercel[bot]

Codecov Report

Merging #712 (598f1c4) into master (452d917) will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #712   +/-   ##
=======================================
  Coverage   99.50%   99.50%           
=======================================
  Files          25       25           
  Lines        1010     1010           
  Branches      335      335           
=======================================
  Hits         1005     1005           
  Misses          4        4           
  Partials        1        1           
Impacted Files Coverage Δ
src/OptionList.tsx 99.28% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 452d917...598f1c4. Read the comment docs.

codecov[bot] avatar Jan 24 '22 03:01 codecov[bot]