feat(modal): enable propagation on underlying page
See original GitHub issueFeature Request
Ionic version:
[x] 5.1.0
Describe the Feature Request
It would be great if when opening a modal you could still edit the underlying page without the opened modal closing. This is especially useful if you define a modal that has a height of less than 100%.
Describe Preferred Solution
The modal controller could be extended by the property: propagate: boolean
.
.ts
public async onOpenModal() {
const modal = await this.modalController.create({
component: ModalPage,
propagate: true,
cssClass: 'sheet-modal',
});
return await modal.present();
}
.scss
.sheet-modal {
position: absolute;
display: block;
top: calc(100% - 200px);
--height: 200px;
}
Additional Context
I have managed to create a sheet modal, but not that the underlying page can be edited:
.ts
public async onOpenModal() {
const modal = await this.modalController.create({
component: ModalPage,
showBackdrop: false,
backdropDismiss: false,
cssClass: 'sheet-modal',
});
return await modal.present();
}
.scss
.sheet-modal .modal-wrapper {
position: absolute;
display: block;
top: calc(100% - (200px));
--height: 200px;
--border-radius: 10px 10px 0px 0px;
--box-shadow: 0px -0.5px 2px 1px rgba(0, 0, 0, 0.1);
}
result the goal of this example is to be able to continue scrolling the map while the modal remains open. Currently, only the modal content can be edited
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (7 by maintainers)
Top Results From Across the Web
Ion-modal - Can't enable touch propagation on underlying page
I am trying to let users interact with the underlying page interactable even while the modal is opened. This would be useful on...
Read more >Building a modal module for React with React-Router
In this article, we'll discuss the various aspects of modals and identify solutions to satisfy the requirements that come with creating dynamic ...
Read more >Prevent Page Scrolling When a Modal is Open | CSS-Tricks
You open a modal, scroll through it, close it, and wind up somewhere else on the page than you were when you opened...
Read more >Event Propagation with a React Modal Window - Medium
One way to allow a background onClick to close the modal, but prevent a window click event from bubbling up to the background...
Read more >How to create an efficient Modal component in React using ...
A modal is a dialog box/popup window that is displayed on top of the current page. You must have used pop-ups and notifications...
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
Oh wow, that simple. Now its working as expected! Took me hours!
Thanks a lot!
Your original example provides a custom CSS class
sheet-modal
, so just target that instead: