(inputEl: HTMLInputElement, pos: number)
| 1 | const setCaretPosition = (inputEl: HTMLInputElement, pos: number): void => { |
| 2 | if (!inputEl || !inputEl.setSelectionRange) return; |
| 3 | |
| 4 | inputEl.focus(); |
| 5 | inputEl.setSelectionRange(pos, pos); |
| 6 | }; |
| 7 | |
| 8 | export default setCaretPosition; |
no outgoing calls
no test coverage detected