Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(modal, popover): quickly opening modal/popover no longer presents duplicates #24697

Merged
merged 1 commit into from
Feb 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions core/src/components/modal/modal.scss
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,6 @@
outline: none;

contain: strict;

pointer-events: none;
}

:host(.modal-interactive) .modal-wrapper,
:host(.modal-interactive) ion-backdrop {
pointer-events: auto;
}

:host(.overlay-hidden) {
Expand Down
3 changes: 1 addition & 2 deletions core/src/components/modal/modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ export class Modal implements ComponentInterface, OverlayInterface {

const showHandle = handle !== false && isSheetModal;
const mode = getIonMode(this);
const { presented, modalId } = this;
const { modalId } = this;
const isCardModal = presentingElement !== undefined && mode === 'ios';

return (
Expand All @@ -605,7 +605,6 @@ export class Modal implements ComponentInterface, OverlayInterface {
[`modal-card`]: isCardModal,
[`modal-sheet`]: isSheetModal,
'overlay-hidden': true,
'modal-interactive': presented,
...getClassMap(this.cssClass)
}}
id={modalId}
Expand Down
7 changes: 0 additions & 7 deletions core/src/components/popover/popover.scss
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,6 @@
color: $popover-text-color;

z-index: $z-index-overlay;

pointer-events: none;
}

:host(.popover-interactive) .popover-content,
:host(.popover-interactive) ion-backdrop {
pointer-events: auto;
}

:host(.overlay-hidden) {
Expand Down
3 changes: 1 addition & 2 deletions core/src/components/popover/popover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ export class Popover implements ComponentInterface, PopoverInterface {

render() {
const mode = getIonMode(this);
const { onLifecycle, popoverId, parentPopover, dismissOnSelect, presented, side, arrow, htmlAttributes } = this;
const { onLifecycle, popoverId, parentPopover, dismissOnSelect, side, arrow, htmlAttributes } = this;
const desktop = isPlatform('desktop');
const enableArrow = arrow && !parentPopover && !desktop;

Expand All @@ -584,7 +584,6 @@ export class Popover implements ComponentInterface, PopoverInterface {
[mode]: true,
'popover-translucent': this.translucent,
'overlay-hidden': true,
'popover-interactive': presented,
'popover-desktop': desktop,
[`popover-side-${side}`]: true,
'popover-nested': !!parentPopover
Expand Down
7 changes: 6 additions & 1 deletion core/src/utils/overlays.ts
Original file line number Diff line number Diff line change
Expand Up @@ -502,8 +502,13 @@ export const dismiss = async (

activeAnimations.delete(overlay);

// Make overlay hidden again in case it is being reused
/**
* Make overlay hidden again in case it is being reused.
* We can safely remove pointer-events: none as
* overlay-hidden will set display: none.
*/
overlay.el.classList.add('overlay-hidden');
overlay.el.style.removeProperty('pointer-events');

} catch (err) {
console.error(err);
Expand Down