Approved
Last Updated: 27 Dec 2016 12:24 by ADMIN
ADMIN
Dinko
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"
(Total attached files size should be smaller than 20mb. Allowed extensions: .zip, .rar, .jpg, .png, .gif)
0 comments