Open
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
v7.x
Current Behavior
- Create and present a modal using controller method
const [present, dismiss] = useIonModal(ModalExample)
...
function openModal() {
present();
}
...
- From within the modal have a button that triggers an IonPopover
...
<IonButton id="click-trigger-2">Trigger Popover</IonButton>
<IonPopover dismissOnSelect trigger="click-trigger-2" triggerAction="click">
<IonContent class="ion-padding">
Hello World!
<IonButton expand="block" onClick={onClick}>I'm clickable</IonButton>
</IonContent>
</IonPopover>
...
- For any element within that IonPopover (eg IonItem, IonButton, etc) any
onClick
handler will not get invoked. NOTE: However it's interesting that the click event is received by the IonPopover itself b/c settingdismissOnSelect
does in fact dismiss the popover upon click.
...
function onClick (ev: React.MouseEvent) {
console.log('onPopoverItemClick From Modal!!') // <===== this is never called
}
...
Expected Behavior
For any element within an IonPopover (eg IonItem, IonButton, etc) it's onClick
handler should be invoked when clicked.
Steps to Reproduce
Source code for demonstrating the issue: src/pagesHome.tsx
To Reproduce Issue:
- Get and run the code reproduction project from git hub using provided link
- Click on the "Open Modal" button
- Click on the "Trigger Popover" button
- Click on the "I'm Clickable" button inside the popover - note the
onClick
handler is not invoked and the resulting console log is not displayed
NOTE: From the main page (outside of the modal) you can click the "Trigger Popover" button and the Button within it works as expected.
Code Reproduction URL
https://github.com/jonesdhtx/ionic-test-case-1
Ionic Info
Ionic:
Ionic CLI : 7.2.0
Ionic Framework : @ionic/react 7.6.4
Capacitor:
Capacitor CLI : 5.6.0
@capacitor/android : not installed
@capacitor/core : 5.6.0
@capacitor/ios : not installed
Utility:
cordova-res : not installed globally
native-run : 2.0.0
System:
NodeJS : v16.14.0
npm : 8.12.1
OS : macOS Unknown
Additional Information
No response