Open wmertens opened 7 years ago
@mxstbr ?
Ah the reason is that the Modal is position: fixed
. Then you can't have an offset and the popout should be portaled in the modal.
I can't reproduce, can you add more details?
@jossmac I noticed this in the keystone-test repo, pretty far down the page. I assume that if you are at the top, it's not a problem.
err sorry I'm mixing up repos. It's our own project, and the relationship field is quite far down. Try scrolling down the page as low as you can to click the create?
I think the only sane solution is to implement the modal with position: absolute
.
In compliance with the specification, this property will return null on Webkit if the element is hidden (the style.display of this element or any ancestor is "none") or if the style.position of the element itself is set to "fixed". -- https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/offsetParent
@mxstbr can you reproduce this?
@jossmac @mxstbr to repro go to Events in Keystone-test, use the devtools to make your screen super short, scroll down and click on Create.
Result:
Thanks @wmertens!
I was able to fix it in devtools by making the modal div position: absolute
, giving it a height and setting the top to the scrollposition of the main window. That latter is the tough bit I guess.
@jossmac any progress on this? I noticed that https://github.com/reactjs/react-modal is using absolute
as well, any reason why we're not simply using that? More eyeballs, accessible etc…
@wmertens happy for you to implement https://github.com/reactjs/react-modal. Just make it look/behave identical to current implementation
When you have a createForm with a DateInput, it doesn't show a popup date, because the modal is at +2000 and for some reason PopOut can't find the correct offset to show the popup at.