( textarea: HTMLTextAreaElement, [start, end]: number[], )
| 33 | |
| 34 | /* eslint-disable no-param-reassign */ |
| 35 | export const focusInput = async ( |
| 36 | textarea: HTMLTextAreaElement, |
| 37 | [start, end]: number[], |
| 38 | ): Promise<void> => { |
| 39 | textarea.focus(); |
| 40 | await nextTick(); // for the selection to work, we need to wait for the input to get updated |
| 41 | textarea.selectionStart = start; |
| 42 | textarea.selectionEnd = end; |
| 43 | }; |
| 44 | |
| 45 | export const getCloseWord = ( |
| 46 | textarea: HTMLTextAreaElement, |
no test coverage detected