datetimepicker
datetimepicker copied to clipboard
Problem with scroll after changing allowed times
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?
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.
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:
+1
i got exactly the same issue.
+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.
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.
This is only a problem in popup mode. Inline the scrolling works fine.
Any fix for this? Still facing the issue in 2021
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);