text-mask: Masking problem on mobile devices

When typing in computer browsers works perfectly, however in some cell phones the problem occurs. It follows below in which cell phones the problems occurred.

Steps to Reproduce: The given date mask is __/__/____ Typed 1 is expected 1|_/__/____ and occurs |1_/__/____ Typed 2 is expected 12|/__/____ and occurs |21/__/____ Typed 3 is expected 12/3|_/____ and occurs |32/1_/____ Typed 4 is expected 12/34|/____ and occurs |43/21/____

The pipe (|) represents the cursor.

Occurrences: Moto G2 - Chrome 56.0.2924.87 - Android 6.0 (not problem) Samsung Duos - Chrome 52.0.2743.91 - Android 4.3.0 (problem) Samsung Galaxy J7 Prime - Chrome 56.0.2924.87 - Android 6.0 (problem)

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 19 (8 by maintainers)

Most upvoted comments

I debugged this same problem in a different library. Here is what I found.

https://github.com/angular-ui/ui-mask/pull/200

I have not debugged this library yet, but I am curious if you changed https://github.com/text-mask/text-mask/blob/6094d1bf7e4bf1d7ac7a2c674208109c2243166d/core/src/createTextMaskInputElement.js#L72 to say selectionEnd instead if this problem would go away and work on all devices like it did for me in the other library.