Skip to content
This repository was archived by the owner on Mar 4, 2020. It is now read-only.

fix: refactored highlightedIndex on Arrow keydown#1570

Merged
silviuaavram merged 5 commits intomasterfrom
fix/dropdown-highlightedIndex-on-open
Jul 3, 2019
Merged

fix: refactored highlightedIndex on Arrow keydown#1570
silviuaavram merged 5 commits intomasterfrom
fix/dropdown-highlightedIndex-on-open

Conversation

@silviuaavram
Copy link
Collaborator

@silviuaavram silviuaavram commented Jul 2, 2019

Initiate highlightedIndex on ArrowUp and ArrowDown open.
Refactored how the index is calculated.
If user passes anything related to highlightedIndex, then we don't change its value on open, even on Arrow Up/Down. This includes controlled highlightedIndex, defaultHighlightedIndex or highlightFirstItemOnOpen.
Fixes #1176

Avoided major refactoring in this area as I want to use hooks in the future rather than have this logic here anymore.

@silviuaavram silviuaavram added 🚀 ready for review accessibility All the Accessibility tasks and bugs should be tagged with this. labels Jul 2, 2019
@codecov
Copy link

codecov bot commented Jul 2, 2019

Codecov Report

Merging #1570 into master will decrease coverage by 0.02%.
The diff coverage is 90%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1570      +/-   ##
==========================================
- Coverage   71.66%   71.63%   -0.03%     
==========================================
  Files         848      848              
  Lines        6910     6910              
  Branches     1963     1981      +18     
==========================================
- Hits         4952     4950       -2     
- Misses       1952     1954       +2     
  Partials        6        6
Impacted Files Coverage Δ
...ackages/react/src/components/Dropdown/Dropdown.tsx 88.1% <90%> (-0.51%) ⬇️

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 d237ca0...1d5c8c3. Read the comment docs.

@silviuaavram silviuaavram merged commit e312aa7 into master Jul 3, 2019
@delete-merged-branch delete-merged-branch bot deleted the fix/dropdown-highlightedIndex-on-open branch July 3, 2019 15:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

accessibility All the Accessibility tasks and bugs should be tagged with this. 🚀 ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Highlight first index on opening Dropdown by ArrowDown

2 participants