Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Pressing up with all options disabled underflowing #712

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nathan-knight
Copy link

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.

@vercel
Copy link

vercel bot commented Jan 21, 2022

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

@codecov
Copy link

codecov bot commented Jan 24, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant