Skip to content

Unable to close Datepicker popover with 'Esc' in DateInput #7857

@Lenwyths

Description

@Lenwyths

Dependencies check up

  • I have verified that I use latest version of all @mantine/* packages

What version of @mantine/* packages do you have in package.json?

8.0.1

What package has an issue?

@mantine/dates

What framework do you use?

Other, I will specify in the bug description

In which browsers you can reproduce the issue?

All

Describe the bug

According to WCAG Success Criterion 1.4.13, additional content like popovers/tooltips etc that trigger when focusing something should be dismissible without leaving items focus state if they're not an error or not obscuring something else.

In the case of DateInput it's very likely that it'll obscure something else when active and as such should ideally have a way to close the Datepicker popover without moving the focus.

I'm assuming the intent with this component, is that the Datepicker is mainly there as a visual help and the "main" intent is to enter date by keyboard rather than clicking in the popover. Never the less, we can make it more accessible!

If possible, include a link to a codesandbox with a minimal reproduction

No response

Possible fix

I'm proposing we simple add a handler that listens for the Esc keydown and set the popover visible state to false. Any typing into the input would of course open it again. Which is fine, and expected!

Self-service

  • I would be willing to implement a fix for this issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    FixedCompleted issues that will be published with next patch (1.0.X)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions