Skip to content

feat: @capacitor/action-sheet - allow click-outside and back-button on ActionSheet on Android #2154

Open
@funkyvisions

Description

@funkyvisions

Feature Request

Plugin

action-sheet

Description

Would be nice if tapping outside of the ActionSheet or using the hardware/software back button would close the ActionSheet.

Platform(s)

Android

Preferred Solution

Add the following to ActionSheetPlugin.java

Change

implementation.setCancelable(false);

to

           implementation.setCancelable(true);
           implementation.setOnCancelListener(() -> {
               implementation.dismiss();
               JSObject ret = new JSObject();
               ret.put("index", -1);
               call.resolve(ret);
           });

Alternatives

None

Additional Context

None

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions