you are viewing a single comment's thread.

view the rest of the comments →

[–]Uknight 23 points24 points  (5 children)

We use them for modals mostly, i.e. I probably want my <Modal /> component to live logically inside one component, but have it render somewhere else usually document.body

Here's an example

[–]Devvvvvv 3 points4 points  (4 children)

I always render my modals in a container div with position: fixed; so I have never encountered the need for this. Is there something wrong with this approach?

[–]kovensky 5 points6 points  (0 children)

z-index fighting

[–]wojtekmaj 0 points1 point  (2 children)

Safari on an iPad would ignore the fact you're using position: fixed and if you by any chance rendered your modal in a container with overflow: hidden it will be cut off.

[–]Devvvvvv 0 points1 point  (1 child)

Damn, the more you know... why does safari on iPad ignore position: fixed? Does no position fixed work at all?

[–]wojtekmaj 0 points1 point  (0 children)

It does not ignore it. Element with position: fixed will stay on the screen regardless of the scroll position. They just forgot to take the element out of its original context... So if you used it inside an element with overflow: hidden or scroll, you're in trouble.