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

Allow a popup with an overlay to display on top of other popups #1002

Open
marklchaves opened this issue Jul 7, 2022 · 2 comments
Open

Allow a popup with an overlay to display on top of other popups #1002

marklchaves opened this issue Jul 7, 2022 · 2 comments

Comments

@marklchaves
Copy link
Contributor

Describe the feature request

Right now when you have:

  1. More than one popup appears on the same page.
  2. One of those popups has an overlay turned on.

Then, the overlay doesn't show for the popup that has the overlay turned on.

It'd be great to have the overlay show for the one popup that has overlay turned on (giving it a higher display priority).

Use case

Original OP's use case:

  1. Create a popup with no overlay.
  2. Create a popup with an overlay.
  3. Display both popups on the same page.
  4. Both overlays are hidden.

Example screenshots (if any)

@marklchaves
Copy link
Contributor Author

marklchaves commented Jul 7, 2022

The workaround is a manual CSS fix.

/* Force the overlay to display for the popup that has an overlay when there are multiple popups. */
html.pum-open.pum-open-overlay-disabled.pum-open-scrollable .pum-overlay.pum-active {
  position: fixed;
  /* visibility: visible; Add this if needed. */
}
/* NOTE: Reduce the z-index for the other popups. */

Ideally, the permanent fix should make needed adjustments automatically. We might need a rule that only 1 popup can have an overlay on a page.

@danieliser
Copy link
Member

This comes from the fact our body classes control overlay visibility. Just needs to be recoded to not rely on those things.

The body classes are intended to fix issues that come up from the documents main scroll bar as well as controlling aria-hidden.

It was then used (I believe) to control the way popup overlays were handled because we were already modifying those classes on popup open, and it seemed to handle every use case I was covering at the time. Partially because it didn't require writing custom CSS to the page for every popup, but we already have that feature built out and optimized so not such a big deal now.

Now we need to control the visibility of each popup via CSS output for that popup based on its settings.

If you want to take a crack at that I'll point you in the right direction, should probably encompas:

  • removing some of the logic from global body
  • modifying the per popup generated CSS to add visibility modifiers as needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants