question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Getting weird clipping on Backdrop when used with Docz

See original GitHub issue

🐛 Bug report

Current behavior

The DialogBackdrop appears to be having some strange issues with its position in the DOM.

image

Any Playground after the modal that you trigger appears above/“to clip” the DialogBackdrop.

The Playground has these styles applied by Docz.

    top: 0;
    left: 0;
    z-index: 0;
    position: relative;
    width: auto;
    height: auto;
    padding: 0px;
    margin: 0 0 30px;
    background: transparent;
    box-sizing: border-box;
    -webkit-transition: background 0.3s;
    transition: background 0.3s;

The DialogBackdrop has these styles applied by me:

  background-color: rgba(0, 0, 0, 0.5);
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 9998;
  transition: opacity 300ms;
  opacity: 1;

  &.hidden {
    opacity: 0;
  }

Expected behavior

I expect the DialogBackdrop to be over all other elements in this page.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
diegohazcommented, Jul 24, 2019

Thanks for the reproduction! 😃

Looks like the z-index on Playground is creating a new composite layer for the backdrop. If you remove z-index from the playground, it works.

The solution is indeed rendering DialogBackdrop in a Portal. We can think of a way to do that automatically if the dialog is modal.

0reactions
stramelcommented, Jul 24, 2019

@diegohaz I managed to get the issue reproduced inside a codesandbox.

Here is the link, let me know if you have any issues. https://codesandbox.io/s/github/stramel/reakit-issue-404/tree/master/

Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting weird clipping on Backdrop when used with Docz #404
Bug report Current behavior The DialogBackdrop appears to be having some strange issues with its position in the DOM.
Read more >
How do I fix weird clipping glitch on my Object with Image ...
I am currently working in Blender in Eevee and getting a really weird glitch where I can see random faces of my object...
Read more >
CSS background-size: cover + background-attachment: fixed ...
When each of the figures takes up the entire viewport, this works fine, but if there is an offset of any kind the...
Read more >
Background2D — photutils 1.6.0 - Read the Docs
Class to estimate a 2D background and background RMS noise in an image. The background is estimated using (sigma-clipped) statistics in each box...
Read more >
CanvasRenderingContext2D.clip() - Web APIs - MDN Web Docs
The even-odd winding rule. path. A Path2D path to use as the clipping region. Return value.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found