Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(action-sheet): Add cancelable parameter #2285

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

OS-pedrogustavobilro
Copy link
Contributor

Add parameter to allow action-sheet to be cancelable (clicking outside the sheet, and using the system back button on Android), and in case it is canceled, return it in the result.

Notes:

Fixes #2154

Copy link

github-actions bot commented Dec 17, 2024

Released dev build of action-sheet with dev version: 7.0.0-dev-2285-20250113T110659.0

@@ -17,21 +17,26 @@ public class ActionSheetPlugin: CAPPlugin, CAPBridgedPlugin {
@objc func showActions(_ call: CAPPluginCall) {
let title = call.options["title"] as? String
let message = call.options["message"] as? String
let cancelable = call.options["cancelable"] as? Bool ?? false
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe there's a getBool with a default value within the CAPPluginCall, maybe we can use it.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't there a getString as well?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But those @OS-pedrogustavobilro didn't change, so I'm not sure if they're worth the change.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not super important, but I think if we change one we should change the others to keep the way we access CAPPluginCall's parameters consistent.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 99443ae

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

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