Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scrolling to selection doesn't work, and broken after reload #142

Open
Kuirtevich opened this issue May 23, 2023 · 0 comments
Open

Scrolling to selection doesn't work, and broken after reload #142

Kuirtevich opened this issue May 23, 2023 · 0 comments

Comments

@Kuirtevich
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant