Skip to content

Comments

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

Open
OS-pedrogustavobilro wants to merge 17 commits intomainfrom
feat/RMET-3576/action-sheet-cancelable
Open

feat(action-sheet): Add cancelable parameter#2285
OS-pedrogustavobilro wants to merge 17 commits intomainfrom
feat/RMET-3576/action-sheet-cancelable

Conversation

@OS-pedrogustavobilro
Copy link
Contributor

@OS-pedrogustavobilro OS-pedrogustavobilro commented Dec 17, 2024

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:

  • The cancelable parameter is not configurable for iOS - the sheet is always cancelable. I've tried to work around this but wasn't able to get it not both not cancel and return a result to the plugin at the same time across different iOS versions (most notably iOS 26). Alternatively we could use a custom UIController, but it wouldn't guarantee to look the same as it does + since the issue was manually for Android, I don't think we need to go into that level of detail.
  • For this to work with PWAs, it requires feat: Add onCanceled event for action sheet pwa-elements#138 - version 3.4.0 of pwa-elements

To test, use this branch from capacitor-test-app, that has the latest dev build of action-sheet plugin - https://github.com/ionic-team/capacitor-testapp/tree/feat/test-new-action-sheet-feature

Fixes #2154

@github-actions
Copy link

github-actions bot commented Dec 17, 2024

Released dev build of action-sheet with dev version: 8.0.2-dev-2285-20260220T160338.0

@OS-pedrogustavobilro OS-pedrogustavobilro requested review from a team and alexgerardojacinto and removed request for IT-MikeS and OS-martacarlos February 20, 2026 16:28
@OS-pedrogustavobilro
Copy link
Contributor Author

Hey @alexgerardojacinto @jcesarmobile I had to make some adjustments to the iOS implementation, due to changes in iOS 26 (and also fixing some stuff that was broken in the old implementation), also updated the PR description, feel free to review whenever you can 🙏

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