Skip to content

Commit

Permalink
Fixed the cursor positions on Android devices to use selectionEnd ins…
Browse files Browse the repository at this point in the history
…tead of selectionStart. (text-mask#503)
  • Loading branch information
travist authored and lozjackson committed Apr 18, 2017
1 parent a486ef7 commit 4e07008
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/src/createTextMaskInputElement.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ export default function createTextMaskInputElement(config) {
// If it's something we can't work with `getSafeRawValue` will throw.
const safeRawValue = getSafeRawValue(rawValue)

// `selectionStart` indicates to us where the caret position is after the user has typed into the input
const {selectionStart: currentCaretPosition} = inputElement
// `selectionEnd` indicates to us where the caret position is after the user has typed into the input
const {selectionEnd: currentCaretPosition} = inputElement

// We need to know what the `previousConformedValue` and `previousPlaceholder` is from the previous `update` call
const {previousConformedValue, previousPlaceholder} = state
Expand Down

0 comments on commit 4e07008

Please sign in to comment.