Closed
Description
Prerequisites
- I have read the Contributing Guidelines.
- I agree to follow the Code of Conduct.
- I have searched for existing issues that already report this problem, without success.
Ionic Framework Version
- v4.x
- v5.x
- v6.x
- Nightly
Current Behavior
The dismiss
method from the useIonModal
hook does not accept data
or role
properties. This prevents developers from easily dismissing a modal and passing data back in the didDismiss
event.
Expected Behavior
dismiss
should accept two parameters, data
and role
, just as all other implementation patterns do. This information should be forwarded to the inner dismiss
call within the implementation:
overlayRef.current && (await overlayRef.current.dismiss(data, role));
Steps to Reproduce
const [present, dismiss] = useIonModal(ModalExample, {});
dismiss(); // does not accept arguments for data and role
Code Reproduction URL
https://stackblitz.com/edit/react-1udk9j?file=main.js
Ionic Info
N/A
Additional Information
No response