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(date-picker): date-picker within a popover-container closes when tabbing #7188

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mihai-albu-sage
Copy link
Contributor

Modified the handleOnDayKeyDown handler inside the DatePicker to prevent interfering with the useFocusPortalContent hook.

Proposed behaviour

popover-after.mp4

Current behaviour

When using the keyboard navigation the handleOnDayKeyDown handler inside the DatePicker focuses the second input of the date range. useFocusPortalContent determines the last item is focused. On the next keyboard navigation event, the focus moves from the second date range input inside of the react day picker. Since , from the useFocusPortalContent perspective we just lost the focus on the last element, it will close the popover.

popover-before.mp4

Checklist

  • Commits follow our style guide
  • Related issues linked in commit messages if required
  • Screenshots are included in the PR if useful
  • All themes are supported if required
  • Unit tests added or updated if required
  • Playwright automation tests added or updated if required
  • Storybook added or updated if required
  • Translations added or updated (including creating or amending translation keys table in storybook) if required
  • Typescript d.ts file added or updated if required
  • Related docs have been updated if required

QA

  • Tested in provided StackBlitz sandbox/Storybook
  • Add new Playwright test coverage if required
  • Carbon implementation matches Design System/designs
  • UI Tests GitHub check reviewed if required

Additional context

Testing instructions

Copy link
Contributor

@nuria1110 nuria1110 left a comment

Choose a reason for hiding this comment

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

suggestion (non-blocking): Even though this will probably require manual testing, we could add a playwright test to make sure the Tabbing order doesn't break in the future.

…tabbing

modified the handleOnDayKeyDown handler to prevent interfering with the useFocusPortalContent
@mihai-albu-sage
Copy link
Contributor Author

suggestion (non-blocking): Even though this will probably require manual testing, we could add a playwright test to make sure the Tabbing order doesn't break in the future.

Added a new playwright test to check the keyboard navigation for the DateRange when it is inside of a PopoverContainer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

4 participants