capacitor-plugins icon indicating copy to clipboard operation
capacitor-plugins copied to clipboard

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

Open funkyvisions opened this issue 7 months ago • 1 comments

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

funkyvisions avatar Jul 17 '24 18:07 funkyvisions