AjaxControlToolkit icon indicating copy to clipboard operation
AjaxControlToolkit copied to clipboard

MaskedEditExtender: initial cursor position is inconsistent among browsers

Open tjbortz1s opened this issue 5 years ago • 3 comments

16.1 and 19.0

The installation method

  • [ ] Installer
  • [X] NuGet package
  • [ ] A custom build from the source code

Minimal steps to reproduce the bug

Create a new .aspx page with a textbox and a masked edit extender with mask format 9999.

In firefox and edge, the cursor will start on the left-most side no matter where you click, allowing you to type out the numbers that should be in the box.

In chrome, the cursor starts on the right-most side, which means that users have to backspace four times before they can enter the numbers.

During testing, it appears that opening the popup debugger window (F12) then closing it will cause the cursor to end up in the correct position.

A site deployment method

  • [X] VS development web-server,
  • [] IIS

WebFormsAjaxExtenderTest.zip

tjbortz1s avatar Jan 15 '20 19:01 tjbortz1s

I confirm the difference in the initial cursor position.

Interestingly, when the text box is not empty or when ClearMaskOnLostFocus="false" is specified, Chrome provides better usability.

AlekseyMartynov avatar Jan 17 '20 09:01 AlekseyMartynov

Awesome, it's good to know that I can throw a 0 in there if need be. I'll look into either doing that or setting ClearMaskOnLostFocus to work as a hopefully temporary fix.

tjbortz1s avatar Jan 20 '20 21:01 tjbortz1s

My experience with this, in Chrome using a date mask, has been the cursor is located where ever the click occurred...left, right, middle. It is kind of annoying. If the control is empty and simply displaying the mask, my expectation would be positioning the cursor to the far left (being English) when clicking anywhere in the box.

donvnielsen avatar May 08 '20 15:05 donvnielsen