feat: Expose `data` in ActionSheet button props
See original GitHub issuePrequisites
- I have read the Contributing Guidelines.
- I agree to follow the Code of Conduct.
- I have searched for existing issues that already include this feature request, without success.
Describe the Feature Request
Currently it is impossible to thread data
through chained ActionSheet instances – one has is to resort to mutable state via button handler
to simulate missing data property (yes, the property exists, but is only populated when invoking dismiss
, which is useless for cases where the user selects an item from the list).
Describe the Use Case
this.action.create({ handler: () => this.mutable = someData, ... }).then(outer => {
outer.onDidDismiss().then(x => {
this.action.create({...}).then(inner => {
const d = this.mutable // only option is mutable state
inner.onDidDismiss().then(...)
inner.present()
})
})
outer.present()
})
Describe Preferred Solution
this.action.create({ buttons: [{data: ...}], ... }).then(outer => {
outer.onDidDismiss().then(x => {
this.action.create({...}).then(inner => {
const d = x.data // data threaded through, no instance level props
inner.onDidDismiss().then(...)
inner.present()
})
})
outer.present()
})
Describe Alternatives
It was suggested in the forum to hijack the role
property as a substitute, which would work if one were only passing string
s, but falls apart for any other data type.
Related Code
No response
Additional Information
No response
Issue Analytics
- State:
- Created 2 years ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
feat: Expose `data` in ActionSheet button props · Issue #23700
The alternative solution is to expose data property at the buttons level such that on every onDidDismiss event built-up state can be accessed ......
Read more >ActionSheet | Apple Developer Documentation
To supply the options, create instances of ActionSheet.Button to distinguish between ordinary options, destructive options, and cancellation of the user's ...
Read more >Action Sheet Data on Handler Event - Ionic Framework
Has any thought been given to having handler in action sheet passing selected value from handler event to onDidDismiss as a data property?...
Read more >react-native-router-flux/CHANGELOG.md - UNPKG
108, - Can't pass props to scene from Action.key\(props\). ... 194, - I would like to reload data when go back from Scene...
Read more >@ui5/webcomponents-react | Yarn - Package Manager
DynamicPageTitle: expose toolbar overflowPopoverRef ref via toolbar props (#3805 ... ActionSheet: expose tabIndex and onFocus of action buttons (#2390 ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for the issue. This has been resolved via https://github.com/ionic-team/ionic-framework/pull/23744, and this feature will be available in an upcoming release of the Ionic Framework v6 beta.
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.