-
Notifications
You must be signed in to change notification settings - Fork 6.1k
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
Scroll page, when show datepicker with fixed input #384
Comments
Got the same issue, would an option like "don't update position when scrolling" be acceptable? |
@xrmx the problem is deeper than that -- the picker window is absolutely positioned on the page, so it doesn't update its position at all on scroll, it just "sits there". I suspect it's the same problem people trying to use modals have been running into. |
@eternicode sure, was wondering if adding a flag was ok or if it should all work automagically. What about trying to append the picker to offsetParent() instead of body (if it's not the html tag) and in this case use a relative offset() from the parent? |
@eternicode i've come up with this https://gist.github.com/xrmx/7115925 works for me after some minimal test, can open a pull request if it looks good |
I haven't looked very closely at better positioning yet (probably for 1.4), but from what I have looked at, it's going to be very complicated, and involve the explicit parent element option that a few PRs have already proposed as well as some sophisticated position detection (because you have to consider all manner of DOM ancestors with different Anyway, it's my opinion that it should work automagically, yes ;) There would be an option for explicitly defining the parent element, like I mentioned, but that would mainly be to allow things like putting the picker in a modal so it doesn't float away when you scroll when a modal is shown. |
@yekibud keeping attribution would have been more nice but glad it works for you ;) |
@xrmx sorry, I thought you would be submitting an official pull request, so I didn't think attribution mattered. Not sure how I can add it back in, at this point. Using Mercurial. One gotcha about the fix: looks like you need to apply |
@xrmx thank you, your fix works for me also |
Issue was fixed in #918 but i discovered still a small issue when page is scrolled before opening the datepicker. I will try to fix this error then this issue should be fixed |
http://fiddle.jshell.net/EGXu9/9/show/
The text was updated successfully, but these errors were encountered: