Unplanned
Last Updated: 27 Dec 2016 12:24 by ADMIN
ADMIN
Dinko | Tech Support Engineer
Created on: 22 Dec 2016 11:18
Category: MaskedInput
Type: Bug Report
0
MaskedInput: Incorrect caret position when you have custom Mask, SelectionOnFocus="CaretToEnd", CaretToEndOfTextOnFocus="True" and PlaceHolder=" "
The workaround is to create a custom class which derives from RadMaskedTextInput and override the OnSelectionOnFocus() method.

 protected override int OnSelectionOnFocus(SelectionOnFocus selectionOnFocus)
        {
            if (MaskedInputExtensions.GetCaretToEndOfTextOnFocus(this))
            {
                return this.Text != null ? this.Text.Length : 0;
            }
            if (selectionOnFocus == SelectionOnFocus.Default)
            {
                return 0;
            }
            return base.OnSelectionOnFocus(selectionOnFocus);
        } 
Then you can set the following properties to the mask:
 -  TextMode="PlainText"
 -  Placeholder=" "
 -  maskedInput:MaskedInputExtensions.CaretToEndOfTextOnFocus="True"
0 comments