-
Notifications
You must be signed in to change notification settings - Fork 91
Description
Hi. Our team have found two problems with the timepicker, which we thought were our improper usage of it, but finally they appeared to be issues of the script itself. I had to make changes in the script to fix them.
First, when you open a dropdown - it does not scroll to the selected value. First I thought this was just not intended to happen, but after analyzing the code, I saw that there is actually logic for it, but it doesn't work because it uses "ui" instead of "viewport" in _hasScroll() and in activate(). The first is not scrollable, while the second is.
Next, if we did ajax reload of the area containing the widget and the initialization script - this made it broken. The reason was in that "widget.viewport" was not assigned in the initializer - there is logic that skips initialization if the DOM element already exists. Also, for the same reason, events were not bound. In the end I have changed that part to remove and recreate the elements in this case.
You can check the updated version attached for more details. Sorry, I am totally new to GitHub, I think I might have collaborated, but I don't know how, and also not sure if this can be done better. So I'm providing this version just as an example. All changed parts are marked as "CUSTOM FIX".
timepicker_updated.txt