This is a migrated thread and some comments may be shown as answers.

[Solved] DatePicker bug with BODY or HTML set to overflow:hidden

3 Answers 389 Views
Date/Time Pickers
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Jonathan
Top achievements
Rank 1
Jonathan asked on 24 Feb 2011, 02:35 AM
I found a DatePicker bug where, if the BODY or HTML element is set to overflow:hidden, the calendar, if at the bottom of the page, will overflow the window.

I'm not sure this is the most efficient fix, but this is what I've add to telerik.datepicker.js (line 278) as a workaround:

var isParentsOverflowHidden = $calendar.parents().filter(function () { return $(this).css('overflow') == 'hidden' || $(this).css('overflow-y') == 'hidden'; }).length > 0;
 
if (isParentsOverflowHidden && elementPosition.top + $calendar.outerHeight() > $(window).height())
    $t.fx._wrap($calendar).css('top', $(window).height() - $calendar.outerHeight());

I tested in Chrome 9.0.597.98, FF3.5 and IE8. Feedback welcomed.

Cheers,
Jonathan

3 Answers, 1 is accepted

Sort by
0
Accepted
Dimo
Telerik team
answered on 24 Feb 2011, 02:47 PM
Hi Jonathan,

Since the Date/Time pickers currently have no screen boundary detection, your workaround is sensible.

Greetings,
Dimo
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
Jonathan
Top achievements
Rank 1
answered on 24 Feb 2011, 07:23 PM
Thanks, Dimo.

Do you know if the Telerik team has any plans to incorporate boundary detection in a future version the the mvc extensions?
0
Dimo
Telerik team
answered on 25 Feb 2011, 08:49 AM
Hi Jonathan,

We will consider implementing such a behavior in the future, based on customer demand and our priorities.

Best wishes,
Dimo
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Tags
Date/Time Pickers
Asked by
Jonathan
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Jonathan
Top achievements
Rank 1
Share this question
or