kartik-v / yii2-widget-timepicker

Enhanced Yii2 wrapper for the bootstrap timepicker plugin (sub repo split from yii2-widgets).
Other
41 stars 12 forks source link

TimePicker: focus on tab should go to hours not to last elements #14

Closed tsdogs closed 5 years ago

tsdogs commented 7 years ago

When a user uses the keyboard tab to switch between inputs (or simply the input gets the focus), when there's a value in the TimePicker, the selection is on last element (AM, seconds or whatever is configured).

If I tab (and focus the input), the selected element should be the first one or at least the whole value. As I can see this is an issue of the javascript part, though the original author hasn't fixed an issue since a long time. I might try to fix this but first would like to know if it's a legitimate behaviour.

tsdogs commented 7 years ago

changing

'focus.timepicker': $.proxy(this.highlightUnit, this),

to

'focus.timepicker': $.proxy(this.highlightHour, this),

should fix the problem. Though a click would first highlight the hour and then next click highlight the clicked element.

You think an option to enable this behaviour should be added?

kartik-v commented 7 years ago

This seems more related to the third party TimePicker plugin - but you can submit a PR to enhance this.

tsdogs commented 7 years ago

Yes, but you enhanced the code, fixed some bugs since the mainstream plug-in seems to be "stalled". I might provide a PR but would you accept the change as reported above? Or do you require me to add an option to enable this behaviour?

[OT] BTW: how do you generate the minified version of the js? [/OT]

kartik-v commented 7 years ago

You can submit an enhancement by providing a configuration option to control the above.

You can generate a minified version of the JS from here

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.