Skip to content
This repository has been archived by the owner on May 14, 2020. It is now read-only.

Unnecessary CSS stacking context (json shows in front of position: xxx; elements) #75

Open
Aprillion opened this issue Mar 17, 2017 · 0 comments

Comments

@Aprillion
Copy link

When rendering JSONTree on a page with absolute/fixed/sticky positioned elements, this will mess up the CSS stacking context, so some of the JSONTree elements that should have been part of the static content now appear in front of the absolute/fixed/sticky element like this:

sticky

reproduction

https://jsfiddle.net/Aprillion/8ohn09yx/

const App = () =>
  <div style={{height: '200vh'}}>
    <h1 style={{position: 'sticky', top: 0, background: 'yellow'}}>sticky header</h1>
    <div className="json">
      <JSONTree data={{a: {b: 0}}} />
    </div>
  </div>

workaround

.json * {
  position: static !important;
  transform: none !important;
}
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant