feat: add strong typing for ModalController dismiss values #20088
Labels
help wanted
a good issue for the community
package: core
@ionic/core package
type: feature request
a new feature, enhancement, or improvement
Feature Request
Ionic version:
[x] 4.x
Describe the Feature Request
Currently the dismissal data of a shown modal is not typed.
onWillDismiss
uses the following signature:OverlayEventDetail
already supports the parametrization butany
type is specified here. Instead it could be using a type specified when creating the modal so thiswould become
Describe Preferred Solution
Add type parameter for
ModalController::create
to specify the possible value returned upon dismissal.Additional Context
This would not improve the typing in the modal component itself as it could still dismiss anything it wishes. I cannot foresee any chance to improve that with the current design but this would at least improve the ergonomics on the parent.
The text was updated successfully, but these errors were encountered: