-
Notifications
You must be signed in to change notification settings - Fork 32
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
feat(DatePicker): Migrate to react-day-picker v8 #3001
base: master
Are you sure you want to change the base?
Conversation
b7a36d7
to
14c90da
Compare
Kudos, SonarCloud Quality Gate passed! |
4f11222
to
2ab8f7e
Compare
374beb0
to
8f34471
Compare
This migrates DatePicker to version 8 of react-day-picker, which includes various important accessibility and keyboard navigation fixes.
This fixes a small bug where when a second date of a range was being selected using the keyboard, the range would stay shading after tabbing from the second date to a different element.
This makes focusing consistent with the W3 WAI-ARIA date picker example.
8f34471
to
9eb0eb2
Compare
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.
We have failing test here but was wondering if this is needed because I cant thing of a scenario when this will happen as its readOnly
@c9qsm62x It was added for coverage IIRC as those code paths still exist in the I think the test has stopped doing what it was meant to since user-event was updated to v14 – |
Test it looks like this behaviour has changed in V8 |
Yep that test looks wrong now as the initial focus is now set to the selected date. Should be something like this I think: describe('when Tab is pressed once', () => {
beforeEach(async () => {
await user.tab()
})
it('traps the focus within the picker', () => {
expect(
wrapper.getByLabelText(PREVIOUS_MONTH_BUTTON_LABEL)
).toHaveFocus()
})
describe('and Shift-Tab is then pressed once', () => {
beforeEach(() => {
return user.tab({ shift: true })
})
it('still traps the focus within the picker', () => {
expect(
wrapper.getByRole('button', { name: '5th December (Thursday)' })
).toHaveFocus()
})
})
}) |
Closing for now because it's very stale - hoping to come back to this soon. |
Related issue
#2871
#2872
Overview
Work in progress PR to migrate DatePicker to react-day-picker v8.
Link to preview
todo
Reason
To resolve various accessibility and keyboard navigation problems.
Work carried out
Demo
todo
Developer notes
todo