Skip to content
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

Closed
orloffv opened this issue Mar 1, 2013 · 10 comments · Fixed by #1227
Closed

Scroll page, when show datepicker with fixed input #384

orloffv opened this issue Mar 1, 2013 · 10 comments · Fixed by #1227
Labels
Milestone

Comments

@orloffv
Copy link

orloffv commented Mar 1, 2013

http://fiddle.jshell.net/EGXu9/9/show/

Screen Shot 2013-03-01 at 2 24 53 PM
Screen Shot 2013-03-01 at 2 25 02 PM
Screen Shot 2013-03-01 at 2 25 11 PM

@xrmx
Copy link
Contributor

xrmx commented Oct 22, 2013

Got the same issue, would an option like "don't update position when scrolling" be acceptable?

@eternicode
Copy link
Contributor

@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.

@xrmx
Copy link
Contributor

xrmx commented Oct 23, 2013

@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?

@xrmx
Copy link
Contributor

xrmx commented Oct 23, 2013

@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

@eternicode
Copy link
Contributor

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 positions [ie, absolute, fixed, etc] and other properties that affect child elements' positions).

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
Copy link

yekibud commented Oct 31, 2013

@xrmx Your fix seems to work for me, so I'll use that in my fork until this is fixed properly. Thanks.

@xrmx
Copy link
Contributor

xrmx commented Oct 31, 2013

@yekibud keeping attribution would have been more nice but glad it works for you ;)

@yekibud
Copy link

yekibud commented Oct 31, 2013

@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 overflow:visible to the datepicker input's container element now to make sure the popover doesn't get cut off.

@thienquach
Copy link

@xrmx thank you, your fix works for me also

@acrobat acrobat closed this as completed Jan 8, 2015
@acrobat acrobat mentioned this issue Jan 8, 2015
6 tasks
@acrobat acrobat reopened this Jan 8, 2015
@acrobat
Copy link
Member

acrobat commented Jan 8, 2015

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants