NumericTextBoxes and Focus

2 posts, 0 answers
  1. Steve
    Steve avatar
    1851 posts
    Member since:
    Dec 2008

    Posted 05 Apr 2012 Link to this post

    Ok so MVVM is creating my numeric textboxes...and I initalize them to 0.

    Problem though is when I tab from item to item it selects the 0 then immediatly deselects it and puts the cursor before the 0.  So that means the user has to delete the 0 instead of just starting to type in the new value

    <input id="myfood-serving-count" type="text" class="my-food-nutinfo-input count" value="1"  data-role="numerictextbox" data-bind="value: measure.size" data-min="0" />

  2. Alexander Valchev
    Alexander Valchev avatar
    2873 posts

    Posted 10 Apr 2012 Link to this post

    Hi Steve,

    This behaviour is not supported out of the box. As a workaround I suggest to hook up to the focus event of the corresponding inputs and select the value. Thus way the user will not need to delete the previous number.

    In this jsFiddle you can find an example using this approach in action.

    All the best,
    Alexander Valchev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top