Prevent default on timepicker input

2 posts, 0 answers
  1. Michael
    Michael avatar
    9 posts
    Member since:
    Feb 2015

    Posted 02 Mar 2015 Link to this post


    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:

            animation: false,
            min: getTimelineStart(offsetMinutes),
            max: getTimelineEnd(offsetMinutes),
            interval: interval,
            change: function(e) {
                var selectedTime = this.value();
                $("#reminderSlider").slider("value", getSliderPointFromTime(selectedTime));

  2. Georgi Krustev
    Georgi Krustev avatar
    3725 posts

    Posted 04 Mar 2015 Link to this post

    Hello Michael,

    The Kendo UI TimePicker widget uses Html input element to allow value typing and form value posting. In general, the default input behaviors are not prevented and I suppose that Bootstrap modal listens to some of them. In order to continue with our investigation, I will ask you to send us a simple repro demo that demonstrates the implementation and the issue. Thus we will be able to review the issue and follow you up with more details.

    Georgi Krustev
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top