Last active
May 28, 2024 15:35
-
-
Save ArtemSites/018c4027bd54e250802bdc2c66826bd4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import setCaretPosition from '/src/utils/setCaretPosition' | |
export default function(e) { | |
let pos = e.target.value.search(/.(?=[^\d]*$)/) | |
if (pos < 4) { | |
// !@note асинхронный обход бага vue-imask на safari 17.1 когда при первом фокусе на vue-imask он ставит курсор в конец инпута телефона | |
setTimeout(() => { | |
setCaretPosition(e.target, 4) | |
}, 1) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment