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(year dropdown options): Year dropdown scroll defaults to center of list #3844

Merged
merged 2 commits into from Jan 30, 2023

Conversation

SashaRepin2
Copy link
Contributor

@SashaRepin2 SashaRepin2 commented Dec 3, 2022

Description bug:
The scroll position of the year dropdown is not scrolled towards the currently selected year. The scroll position will always stay in the center.

Issues:
#3747
#3646

@martijnrusschen
Copy link
Member

Looks like the checks aren't succeeding, can you check what's going on?

@SashaRepin2
Copy link
Contributor Author

SashaRepin2 commented Dec 5, 2022

Hi @martijnrusschen, it was error with test. Object "yearDropdownInstance.dropdownRef.current" doesn't have property "children" in test. In new version for scroll detecting i use this property in logic.
For least changes and clean logic i've decided to fix logic in datepicker main code in condition in didMount

@codecov
Copy link

codecov bot commented Jan 27, 2023

Codecov Report

Merging #3844 (11deb7a) into master (be27eb2) will decrease coverage by 0.06%.
The diff coverage is 75.00%.

@@            Coverage Diff             @@
##           master    #3844      +/-   ##
==========================================
- Coverage   94.60%   94.55%   -0.06%     
==========================================
  Files          20       20              
  Lines        1651     1654       +3     
  Branches      390      393       +3     
==========================================
+ Hits         1562     1564       +2     
  Misses         26       26              
- Partials       63       64       +1     
Impacted Files Coverage Δ
src/year_dropdown_options.jsx 98.07% <75.00%> (-1.93%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@martijnrusschen martijnrusschen merged commit 90802d2 into Hacker0x01:master Jan 30, 2023
p-rogas pushed a commit to p-rogas/react-datepicker that referenced this pull request Mar 22, 2023
Fix(year dropdown options): Year dropdown scroll defaults to center of list
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

2 participants