I use Datepicker UI. If the browser window is so high that the calendar does not fit under the input, the calendar is displayed above the input. I need to make the calendar appear ALWAYS under the input. How to achieve this in the most correct way?

    1 answer 1

    If you look at the jQuery UI source code, the code that displays the calendar first gets the coordinates by calculating the coordinates of the input field and its height , but then passes them through $.datepicker._checkOffset so that the calendar does not $.datepicker._checkOffset beyond the edges of the screen. So, as an option, you can simply change its contents, and not necessarily in the jQuery UI code itself, you can also override the function later:

     $.datepicker._checkOffset = function(_, offset){ return offset; };