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

[Bug]: DatePicker: Cannot select date range using keyboard #17310

Closed
2 tasks done
makafsal opened this issue Sep 2, 2024 · 8 comments
Closed
2 tasks done

[Bug]: DatePicker: Cannot select date range using keyboard #17310

makafsal opened this issue Sep 2, 2024 · 8 comments

Comments

@makafsal
Copy link
Member

makafsal commented Sep 2, 2024

Package

@carbon/react

Browser

Chrome

Package version

v1.65.0

React version

v18.2.0

Description

When trying to select a date range using the keyboard it loses focus after selecting an initial date by pressing the 'Enter' key.

Screen.Recording.2024-09-02.at.4.39.09.PM.mov

Reproduction/example

https://stackblitz.com/edit/github-bmgxxb-ds4ysm?file=src%2FApp.jsx

Steps to reproduce

  1. Press the Tab key and focus on the DatePicker (calendar will appear)
  2. Press the Down Arrow, focus date
  3. Press the Enter key to select the focused date (We can observe that the focus is lost from Calendar)

Suggested Severity

Severity 3 = User can complete task, and/or has a workaround within the user experience of a given component.

Application/PAL

No response

Code of Conduct

@Kritvi-bhatia17
Copy link
Contributor

Hi @makafsal, I can see the focus state on the start date after selecting it. I've added a screenshot and screen recording for reference. Could you please confirm if you're encountering the issue you've mentioned in the 'Date picker range with calendar' or in another variant?

Screen.Recording.2024-09-04.at.12.23.59.PM.mov
Screenshot 2024-09-04 at 12 36 38 PM

@makafsal
Copy link
Member Author

makafsal commented Sep 9, 2024

Hi @Kritvi-bhatia17, Thank you for your response. I figured out that the issue pops up when I give the value property for the DatePicker and DatePickerInput components. Could you please confirm that I need to give the value property?

@Kritvi-bhatia17
Copy link
Contributor

Hi @makafsal! @carbon-design-system/developers will help us with that.

@Geethkadali
Copy link

Hi @Kritvi-bhatia17, we do have a focus issue of a date picker #17398

@Kritvi-bhatia17
Copy link
Contributor

Hi @Geethkadali! Thanks for opening the issue. @carbon-design-system/developers will look into it.

@makafsal
Copy link
Member Author

@Kritvi-bhatia17 - I think you don't need any more info from my end so that you can remove the waiting for author's response label.

@2nikhiltom
Copy link
Contributor

2nikhiltom commented Nov 6, 2024

Hey @makafsal ,

Press the Tab key and focus on the DatePicker (calendar will appear)
Press the Down Arrow, focus date
Press the Enter key to select the focused date (We can observe that the focus is lost from Calendar)

after selecting the start date (start date remains focused ) and when you select the end date the calendar collapse and focus moved back to the triggering element i.e (start input date) and the range is selected
I confirmed same behavior on the shared stackblitz and the reactstorybook - this seems the expected behaviour

Could you expand more on the the issue/required behavior ?

@2nikhiltom
Copy link
Contributor

Closing this since it is the expected behaviour of focus - happy to reopen with more details

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: ✅ Done
Development

No branches or pull requests

6 participants