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(DatePicker): Keyboard Navigation #2241

Merged
merged 8 commits into from
Aug 1, 2024

Conversation

rivka-ungar
Copy link
Contributor

@rivka-ungar rivka-ungar requested a review from a team as a code owner July 17, 2024 13:06
@@ -25,9 +25,9 @@ export interface YearPickerProps {

const YearPicker = ({ selectedDate, isYearBlocked, changeCurrentDate, "data-testid": dateTestId }: YearPickerProps) => {
const selectedYear = selectedDate ? selectedDate.format(YEAR_FORMAT) : moment().format(YEAR_FORMAT);

const currentYear = moment().format(YEAR_FORMAT);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did we needed to add this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the selected year is now the newly selected year I thought it would be confusing if the view of the years changes after each time the user changes a date.


const renderMonthYearSelection = useCallback(() => {
return (
<YearPicker
data-testid={dataTestId || getTestId(ComponentDefaultTestId.DATEPICKER_YEAR_SELECTION, id)}
selectedDate={date}
selectedDate={overrideDateForView || date}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we changing the selected date?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In order to fix the bug in the years select that it wasn't highlighting the newly selected year.

@rivka-ungar rivka-ungar merged commit 8108b06 into master Aug 1, 2024
10 checks passed
@rivka-ungar rivka-ungar deleted the Date-picker-keyboard-nvaigation-6958030426 branch August 1, 2024 10:49
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