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

Setting cursor at the beginning of the control

2 Answers 185 Views
MaskedTextBox
This is a migrated thread and some comments may be shown as answers.
Josh
Top achievements
Rank 1
Josh asked on 08 Nov 2018, 03:45 PM

Hello,

 

In the demo pages (https://demos.telerik.com/aspnet-core/maskedtextbox/index), removing the value from the masked text box and then re-focusing the control places the cursor at the start of the input. This behavior does not appear to be default, as when I used a masked textbox in my project the cursor appears in the middle of the mask (wherever was clicked). I also don't see any mention of it in the demo pages or documentation. Is there a simple way of enabling this behavior?

 

I am using the current release of UI for ASP Core.

<kendo-maskedtextbox name="phone" class="form-control" mask="(999) 000-0000" value="@Model.SearchModel.Phone"></kendo-maskedtextbox>

 

2 Answers, 1 is accepted

Sort by
0
Tsvetomir
Telerik team
answered on 13 Nov 2018, 03:01 PM
Hi Josh,

Based on the provided Kendo UI MaskedTextBox, I conducted a few tests and the behavior exposed in the live demo is the default, built-in. When focusing on the input, the cursor is set in the begging of the input, while, upon the second click, the cursor is set at the place where the mouse was clicked. The only way that the behavior could be observed is if the re-focusing the input element is made with long mouse click and drag, which initiates the selection. This could be observed only in Chrome, which is a browser behavior and we do not have any control over it.

If you are replicating the behavior with a single click over the input element, could you please record a short video and share the exact steps for reproducing the problem.


Kind regards,
Tsvetomir
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Josh
Top achievements
Rank 1
answered on 15 Nov 2018, 03:39 PM

Hi Tsvetomir,

It must have been a script caching or similar issue. After going back to this it is working as expected. Thank you.

Tags
MaskedTextBox
Asked by
Josh
Top achievements
Rank 1
Answers by
Tsvetomir
Telerik team
Josh
Top achievements
Rank 1
Share this question
or