2013.1.514 Bug with km-state-active

3 posts, 0 answers
  1. Cho-Lung
    Cho-Lung avatar
    2 posts
    Member since:
    May 2013

    Posted 06 Jul 2013 Link to this post

    Hello Community,

    First of all I will like to thank Telerik for such a great product, it has been a very good experience developing my first Phonegap in conjunction with Keno UI Mobile, nice work ;)

    Secondly, I have found a Bug with the state of buttons, to be more precise the class km-state-active gets stucked when a button is pressed, in navbar or content, so the user once have used a button from that view (back-button, actionsheet navbar button, button within content to open a link... and so on), will always get the button as pressed or with the  class km-state-active attached to it, resulting in a confusing and not so great user experience, and it also makes the App "less native" in a sense.

    I have found a temporal solution, and will like to get a confirmation (if possible) from the telerik developing team, after trying to track a bit the matter from kendo.mobile.js, I have found that for some reason some of the new events (comparing events from build 2013.1.319) don't seem to work correctly, I will try to explain myself.

    I have used an online javascript beautifier (don't know if links from other sites can be included here) and in line 6725 (this is based in the beautifier I have used, it may differ from your numeration) the function attached to the end it's not even triggering:
    end: function (e) {
        t(r, e, !1)
    What this causes is that the buttons can't listen to the end event and the class km-state-active keeps attached to the element causing this behaviour. 

    My solution is to always attach this to the functions which are correctly called by the events, which are press and tap (I've done it in both just in case), which call the functions _activate and _release respectively, code from line 6719-6724 (I insist these are the lines I obtain after uncompressing Javascript with the online tool):
    press: function (e) {
    tap: function (e) {
    So I included at the end of the called functions what the end event was supposed to be doing, resulting in these modified versions, lines 6747-6765:
    _activate: function (e) {
         var n = document.activeElement,
             i = n ? n.nodeName : "";
         t(this, e, !0), ("INPUT" == i || "TEXTAREA" == i) && n.blur()
         ;t(r, e, !1);
     _release: function (t) {
         var n = this;
         t.which > 1 || n.trigger(c, {
             target: e(t.target),
             button: n.element
         }) && t.preventDefault()
         ;t(r, e, !1);

    After that I minify once more the whole javascript (including the Copyright licence on top once more obviously) and ready to go.

    I don't know if this is the best approach but it did the trick for me, and it could also shed some light in tracking down this Bug from the last production version of Kendo UI Mobile (if it stills there of course...).

    As I said before, thanks for the great product!
  2. Kiril Nikolov
    Kiril Nikolov avatar
    2596 posts

    Posted 08 Jul 2013 Link to this post

    Hi Cho-Lung,

    This is a known issue with the button states in Kendo UI Mobile application. I am glad to inform you that a fix was included in the latest internal build. You can get it by visiting the website and clicking on Manage Products(you need to be logged in). The latest one is 2013.1.703.


    Kiril Nikolov
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Cho-Lung
    Cho-Lung avatar
    2 posts
    Member since:
    May 2013

    Posted 08 Jul 2013 Link to this post

    Hello Kiril,

    Great news, I just sent my App with the old fixed Kendo version, will wait for Apple approval and afterwards will upgrade with some extras we will be adding to the App.

    Thanks again for the info and support.

    Best wishes,
Back to Top