jquery-timepicker icon indicating copy to clipboard operation
jquery-timepicker copied to clipboard

Dropdown does not scroll with input when using `appendTo` option

Open jessehouchins opened this issue 10 years ago • 3 comments
trafficstars

Right now, the support for scrollable containers (other than the window) seems lacking. If i have a time picker (open) in a scrollable div and scroll without clicking (trackpad/mouse wheel) the input moves, but the dropdown stays where it was:

screen shot 2015-06-15 at 8 30 38 am

The solution involves setting event handlers on the inputs scrollable parent(s) to reposition (or close) it when they scroll. Unfortunately, the .scrollParent() method is not part of base jQuery, so we would need to write a custom method to support the feature without requiring jQuery UI. Another option might be to bind to scroll events on all ancestor elements.

jessehouchins avatar Jun 15 '15 13:06 jessehouchins

Does this happen when the picker is appended to something inside the scrollable container, or only when it's appended outside the container (like body)?

jonthornton avatar Jun 16 '15 01:06 jonthornton

probably only outside the container.

jessehouchins avatar Jun 16 '15 02:06 jessehouchins

This is happening to me even when appended to the form which the timepicker input is inside of.

CoralSilver avatar Apr 22 '16 18:04 CoralSilver

The containing element referenced by appendTo needs to have the position: relative CSS rule set.

jonthornton avatar Oct 01 '22 20:10 jonthornton