Skip to content

feat: Use CloseWatcher API for modals etc #28703

@lukewarlow

Description

@lukewarlow

Prerequisites

Describe the Feature Request

It could be useful for ionic to make use of the new close watcher api [1][2] to listen for close signals to close components such as alert dialogs.

[1] https://html.spec.whatwg.org/multipage/interaction.html#the-closewatcher-interface
[2] https://developer.chrome.com/blog/new-in-chrome-120#close-watcher

Describe the Use Case

This API allows listening for escape key presses, along with more platform specific close signals such as Android's back button/ gesture. This would provide a more native feel (matching both the native platform and the web).

It would also improve accesibility as it supports Talkback back gestures too.

Describe Preferred Solution

The close watcher API being used when supported feels like the best solution.

Describe Alternatives

No response

Related Code

No response

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions