The sheet modal I’m displaying is not scrollable / swipeable in the Android emulator. Whether I hover and use the mouse scroll wheel or click-and-drag with the mouse, the sheet acts like it’s a “dismiss” gesture. But since there’s no 0 breakpoint and swipeToClose is implicitly false, the modal just re-appears. So I can’t get to the lower items in the modal list, or to the Cancel / Apply bottoms that are below the list.
The modal content is pretty simple (React):
IonContent
IonHeader
list of IonItems
IonFooter
IonButton (Cancel)
IonButton (Apply)
The code to obtain and display the modal is straightforward:
const [showModal, dismissModal] = useIonModal(
CategoryChooser, // modal component
{ onDismiss: handleModalDismiss } // props to pass to modal component
);
const handleCategoryFilterButtonClick = () => {
showModal({
presentingElement: props.containingPage || undefined,
initialBreakpoint: 0.9,
breakpoints: [0.9],
handle: false,
showBackdrop: false,
swipeToClose: false
});
};
Of course, scrolling/“swiping” works fine in a normal browser. But in the Android emulator, I can’t scroll/swipe. So I can’t test the functionality of the modal at all.
Keyboard action doesn’t work either. I can arrow down which highlights an item in the list, but that stops when it reaches the lowest visible IonItem
.
This comment from the ion-modal
docs implies that Ionic expects a “sheet” modal to be swipeable. But it’s not, at least in the Android emulator:
Note
Note: The
swipeToClose
property has no effect when using a sheet modal as sheet modals must be swipeable in order to be usable.
Is there a special way to accomplish the swiping in the emulator? Or is there a property I can set on the modal to make this work? Or is it a bug or a limitation of the emulator?
Thank you.
Ionic Info:
Ionic:
Ionic CLI : 6.19.0 (C:\Other Programs\nodejs\node_modules\@ionic\cli)
Ionic Framework : @ionic/react 6.1.1
Capacitor:
Capacitor CLI : 3.4.3
@capacitor/android : 3.4.3
@capacitor/core : 3.4.3
@capacitor/ios : 3.4.3
Utility:
cordova-res : 0.15.4
native-run : 1.5.0
System:
NodeJS : v16.14.2 (C:\Other Programs\nodejs\node.exe)
npm : 8.5.0
OS : Windows 10