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

Example of Esc keyboard functionality in TimePicker and DatePicker #855

Closed
elephantcatdog opened this issue Dec 15, 2022 · 1 comment · Fixed by #1875
Closed

Example of Esc keyboard functionality in TimePicker and DatePicker #855

elephantcatdog opened this issue Dec 15, 2022 · 1 comment · Fixed by #1875
Labels
documentation Improvements or additions to documentation

Comments

@elephantcatdog
Copy link
Contributor

elephantcatdog commented Dec 15, 2022

Feature

Based on a comment on the Combined TimePicker PR:

Keyboard nav is missing esc key functionality but I'm not sure where we could add it as "opened" state is controlled by the user.

Both TimePicker and DatePicker are missing this functionality.

Examples

It could be done like in Dialog: have a property 'onClose' that takes a function that closes the component (and maybe the accompanying property 'closeOnEsc' also).

See Dialog.tsx and DialogMain.tsx for starting point.

@elephantcatdog elephantcatdog added the enhancement New feature or request label Dec 15, 2022
@gretanausedaite gretanausedaite added the react Needs change in react package label Dec 23, 2022
@mayank99
Copy link
Contributor

TimePicker and DatePicker don't have a concept of opening/closing. The user is responsible for handling that by using it in their own popover component.

Some of our users already have questions about it (#999) so we should show an example of it on our documentation website both with our "internal" Popover (see sandbox) as well as with an external library (e.g. floating-ui).

@mayank99 mayank99 changed the title Escape keyboard functionality in TimePicker and DatePicker Example of Esc keyboard functionality in TimePicker and DatePicker Jan 30, 2023
@mayank99 mayank99 added documentation Improvements or additions to documentation and removed enhancement New feature or request react Needs change in react package labels Jan 30, 2023
@Ben-Pusey-Bentley Ben-Pusey-Bentley linked a pull request Feb 23, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants