Opened 7 years ago
Last modified 7 years ago
#14980 new bug
Datepicker: Misaligned when attached to a hidden input, inside of a fixed-positioned element, when scrolled down
Reported by: | Mark Penner | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | none |
Component: | ui.datepicker | Version: | 1.11.4 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Here's an example: https://jsbin.com/zijipej/2
Here's the code: https://gist.github.com/anonymous/8cf1943bd68df44d80d5e855455c2a3d
And a screenshot: http://i.imgur.com/x40UB5o.png
Happens in both Chrome and Firefox, unsure about other browsers.
To recreate:
- Open the example
- Scroll down and click "Open Fancybox"
- Click the "..." button
I dug through the jQuery UI source code a bit. When the input element has a "fixed" ancestor, then it puts the ui-datepicker-div into "fixed" position mode too, but the offset calculation is incorrect.
Here's a monkey-patch I created: https://gist.github.com/mnpenner/4a52366150deaa44d377c872c7d1fda3
I haven't thoroughly tested it, but it fixes this particular case.
This is with the patch applied: https://jsbin.com/zijipej/3
Reproduced in both jQuery UI 1.11.4 and 1.10.5.