This is a migrated thread and some comments may be shown as answers.

NumericTextBoxes and Focus

2 Answers 290 Views
MVVM
This is a migrated thread and some comments may be shown as answers.
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
sitefinitysteve asked on 06 Apr 2012, 01:26 AM
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" />

Video: http://www.screencast.com/t/nS2s5XpGio

2 Answers, 1 is accepted

Sort by
0
Alexander Valchev
Telerik team
answered on 10 Apr 2012, 11:52 AM
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!
0
Anton Mironov
Telerik team
answered on 16 Sep 2020, 01:18 PM
Hi,

I would like to share with you that as of Kendo UI version 2020 R3, our team has added the "selectOnFocus" property covering the pointed requirements in this thread.  For your future web development, feel free to utilize this implementation shown here:

 

<input id="numerictextbox" />
<script>
$("#numerictextbox").kendoNumericTextBox({
    selectOnFocus: true
});
</script>

If you have any questions about the new functionality don't hesitate to contact us.

Kind Regards,
Anton Mironov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
MVVM
Asked by
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
Answers by
Alexander Valchev
Telerik team
Anton Mironov
Telerik team
Share this question
or