-
Notifications
You must be signed in to change notification settings - Fork 312
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
fix(DatePicker): Keyboard Navigation #2241
Conversation
@@ -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); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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} |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
https://monday.monday.com/boards/3532714909/views/80492480/pulses/6958030426