Skip to content

Can the CloseWatcher API be utilized in a11y-dialog? #716

@mayank99

Description

@mayank99

The CloseWatcher API provides a browser-native mechanism for listening to "close requests" from the operating system. This includes Esc keypresses on desktop, the "Back" gesture on mobile, as well as some other close requests, such as those from assistive technology (notably VoiceOver on iOS).

Can a11y-dialog make use of this API to offer a better, more inclusive user experience?

I'd imagine it could be added in the same place where it is currently listening for Esc keypresses.

this.$el.addEventListener('keydown', this.bindKeypress, true)

Since CloseWatcher is quite new, feature detection would need to be utilized to conditionally call the API only in supported browsers, while still continuing to call the existing bindKeypress code in older browsers.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions