wvega / timepicker

A jQuery plugin to enhance standard form input fields helping users to select (or type) times
http://timepicker.co
GNU General Public License v2.0
216 stars 93 forks source link

Issue with control binding if div style is set style="display:none" #57

Open Pullal0215 opened 9 years ago

Pullal0215 commented 9 years ago

@wvega if i am binding the timepicker to an input control on a div with style="display:none" and try to move the window the timepicker remains static and does not move along with the bound control.

wvega commented 9 years ago

The Timepicker is positioned dynamically when the input field gains focus. If you move the input or the div containing it, while the Timepicker dropdown is being shown, the position of the Timepicker won't be updated automatically.

I'm afraid the current implementation of the plugin is not going to work with in the situation you describe.

A workaround could be to close and open the dropdown again, once the movement of the window has ended. That is, as soon as you move the window to its final destination, close the dropdown and open it again. Is not a very good solution but it may work.

You can open and close the timepicker using input.timepicker('open') and input.timepicker('close'). Assuming that input is the variable that points to a jQuery object that was previously initialized as a Timepicker, calling input.timepicker( { ... } ).