fix(popover): handle scrolling in content so header can be sticky (#24294)

This commit is contained in:
Amanda Smith
2021-12-06 10:45:37 -06:00
committed by GitHub
parent b083ae4e58
commit f6a00ea954
5 changed files with 108 additions and 2 deletions

View File

@ -374,10 +374,17 @@ const getPageElement = (el: HTMLElement) => {
if (tabs) {
return tabs;
}
const page = el.closest('ion-app,ion-page,.ion-page,page-inner');
/**
* If we're in a popover, we need to use its wrapper so we can account for space
* between the popover and the edges of the screen. But if the popover contains
* its own page element, we should use that instead.
*/
const page = el.closest('ion-app, ion-page, .ion-page, page-inner, .popover-content');
if (page) {
return page;
}
return getParentElement(el);
};