UI Datepicker positioning weirdness when window is too small

UI Datepicker positioning weirdness when window is too small

The datepicker internal utility routine "_checkOffset" apparently tries to adjust the datepicker box's position in order to deal with constrained window sizes. That's a worthy goal, but unfortunately when the window is just plain too small the end result is for the datepicker to be positioned up above the text field completely, with its top sliced off by the window border.

Now clearly if the window is too small then it's too small, and the designer will just have to fix it. The problem is that the way the datepicker ends up is not at all what I would expect: it'd be much clearer to me if the bottom of the dialog were cut off.  In any case, the routine doesn't check to see if the adjustments it makes *also* fall outside the window.  I'd suggest that before it adjusts the position it can check to see if the container will fit in the window at all. If not, then I'd vote that it just give up completely.

Am I misunderstanding what it's trying to do here?