datetimepicker icon indicating copy to clipboard operation
datetimepicker copied to clipboard

Problem with scroll after changing allowed times

Open leo-mck opened this issue 10 years ago • 8 comments

After selecting a date I have to load the allowed times the user can select. I am seeing a strange behavior on some cases when the times list length change. Here is an example: http://jsbin.com/devosesecu/1/edit?html,js,output - try to scroll (using the mouse wheel) on the times list, it will work perfectly. Now click on a date - this will change the allowed times list - now if you try to scroll again on the time list, it will behave strangely. Am I doing something wrong? Is there a way to ask it to recalculate the scroller size?

leo-mck avatar May 29 '15 19:05 leo-mck

What browser are you using? It looks fine on Chrome on Mac.

Edit: I just looked at it again, you are reinitializing the datetimepicker every time a date is selected and you are using different allowTimes.

jonaldomo avatar Jun 17 '15 21:06 jonaldomo

Hey @jonaldomo , thank you for your reply!

Yes, the change on allowTimes is intentional - I should be able to select different hours on different days. The thing is that it looks ok but the time scroll behave strangelly after I click on a different day.

I test it on chrome 43.0.2357.124m, firefox 38.0.5 and IE 11 on win 8.1 (x64) and all behave exactly the same. To reproduce it:

  • open the calendar, move the mouse over the time element and scroll (with mouse scroll) all the way down. It works fine and you can see the last hour allowed (05:00).
  • Now click on a non selected day (change the selected day)
  • move the mouse over the time element and scroll (with mouse scroll) all the way down. With the latest version it gets worst, the scroll stop working and both 09:00 and 09:30 gets selected at the same time:
    capture

leo-mck avatar Jun 22 '15 12:06 leo-mck

+1

i got exactly the same issue.

soeren-helbig avatar Sep 29 '16 14:09 soeren-helbig

+1

Anything new guys ?

For information, clicking 2 times set the scroll correctly. Oh, and for me the issue is not here when the table is defined inline.

JerryBels avatar Jan 18 '17 20:01 JerryBels

I'm having the same issue and it has to do with the time variants div height. Is it possible to initiate a recalculation of the scroll height? Because that would fix the problem for us. When we can have it recalculate the scroll height after changing the date.

TLWebdesign avatar Aug 04 '20 11:08 TLWebdesign

This is only a problem in popup mode. Inline the scrolling works fine.

TLWebdesign avatar Aug 04 '20 11:08 TLWebdesign

Any fix for this? Still facing the issue in 2021

bhaskardabhi avatar Dec 13 '21 14:12 bhaskardabhi

Just went through this. onSelectDate does not resize the scroll! An ugly fix for me was triggering the resize through variable which is changed within the onSelectDate function

const interval = setInterval(function() {
    if (should_resize) {
      var timeboxparent = $('.xdsoft_time_box').eq(0);
      timeboxparent.trigger('resize_scroll.xdsoft_scroller');
      should_resize = false;
      console.log('time picker scroll resized')
    }
 }, 500);

ivan-janev avatar May 18 '23 12:05 ivan-janev