Skip to content

Conversation

@balajis-qb
Copy link
Contributor

@balajis-qb balajis-qb commented Oct 29, 2025

Description

Linked issues: #5970, #5971

Problem

  • For showQuarterYearPicker, the selected quarter receives both react-datepicker__quarter-text--selected and react-datepicker__quarter-text--keyboard-selected, causing the keyboard style to override the selected style and diverge from other pickers.
  • With selectsMultiple, not all selected quarters consistently show the react-datepicker__quarter-text--selected style.

Changes

  • Skip adding react-datepicker__quarter-text--keyboard-selected when a quarter is already selected, matching behavior of other picker modes.
  • Ensure multi-select logic applies react-datepicker__quarter-text--selected to every selected quarter, regardless of selection order.
  • Harmonize quarter selected vs keyboard-selected class behavior to be consistent with month/year/day pickers.
  • Add tests to cover both single-select and selectsMultiple quarter selection flows.

These fixes are based on the latest commits addressing #5970 and #5971.

React-Datepicker-crafted-by-HackerOne.7.mp4

…ass to the selected element

- Updated the `isSelectedQuarter` method to properly compare the selected quarter.
- Introduced `isQuarterSelected` method to handle quarter selection logic.
- Added a test to ensure the keyboard-selected class is not applied when the quarter is part of the selected date.

Closes Hacker0x01#5970
- Introduced `isSelectQuarterInList` method to handle selection of multiple quarters.
- Updated the rendering logic to apply the selected class based on the new method.
- Added tests to verify correct application of the selected class for both single and multiple selected dates.

Closes Hacker0x01#5971
@codecov
Copy link

codecov bot commented Oct 29, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.30%. Comparing base (3da627e) to head (677ee67).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5972   +/-   ##
=======================================
  Coverage   97.29%   97.30%           
=======================================
  Files          30       30           
  Lines        3470     3482   +12     
  Branches     1472     1476    +4     
=======================================
+ Hits         3376     3388   +12     
  Misses         94       94           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@martijnrusschen martijnrusschen merged commit 52e1ee2 into Hacker0x01:main Oct 29, 2025
6 checks passed
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.

2 participants