Fix #5200: Fix the unnecessary highlight on the Week Number when the first day of the week is selected using Keyboard #37
+0
−70
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes Hacker0x01#5200
Description
As mentioned in the ticket, when
showWeekNumbers
is enabled in a datepicker, the keyboard select on the first day of the week alone highlights the week number. When we select any other week days it's not highlighting. This issue is not occuring in the mouse hover of any week days.Why the issue occurs?
As I shared in the above screenshot, we passed the start of the week to each corresponding week number and in the
<WeekNumber />
component we apply a classreact-datepicker__week-number--keyboard-selected
when the date prop (which is start of the week) is selected.Changes
react-datepicker__week-number--keyboard-selected
to . The reason is because we are not applying any class to it when we hover the first day of the week using mouse. Also if we plan to highlight the week number it should enabled for all week days and not just the start date and it should be applied to the mouse hover aswell. But I don't think that's necessary as the week number we're displaying is just looks like a read-only kind of view, as it's grayed out currently. Hence I feel removing the classreact-datepicker__week-number--keyboard-selected
would be a better way to fix the issue.Contribution checklist