Hi,
I have a timepicker in a bootstrap modal. All works great with one exception, when I enter a time via the keyboard and hit return the event triggers and the modal is closed. I tried e.preventDefault() on the change event but this didn't work. I also tried binding a click event to the input itself and trying to preventDefault on that directly, but it is overridden. If you select a time from the dropdown via the mouse then it behaves as expected, it is only on manually typing the time that the problem occurs, which is different to the native HTML dropdown menu behaviour (latest Chrome).
Is there any way to suppress this and fire the change event?
Hope that makes sense and here is my code:
I have a timepicker in a bootstrap modal. All works great with one exception, when I enter a time via the keyboard and hit return the event triggers and the modal is closed. I tried e.preventDefault() on the change event but this didn't work. I also tried binding a click event to the input itself and trying to preventDefault on that directly, but it is overridden. If you select a time from the dropdown via the mouse then it behaves as expected, it is only on manually typing the time that the problem occurs, which is different to the native HTML dropdown menu behaviour (latest Chrome).
Is there any way to suppress this and fire the change event?
Hope that makes sense and here is my code:
$(
"#reminderTimepicker"
).kendoTimePicker({
animation:
false
,
min: getTimelineStart(offsetMinutes),
max: getTimelineEnd(offsetMinutes),
interval: interval,
change:
function
(e) {
e.preventDefault();
var
selectedTime =
this
.value();
$(
"#reminderSlider"
).slider(
"value"
, getSliderPointFromTime(selectedTime));
}
});