only honor selection range in textarea

This commit is contained in:
keyan 2023-06-12 17:21:13 -05:00
parent 5958875f1e
commit 6a49f37c68
1 changed files with 3 additions and 1 deletions

View File

@ -187,7 +187,9 @@ function InputInner ({
if (selectionRange.start <= selectionRange.end && innerRef?.current) {
const { start, end } = selectionRange
const input = innerRef.current
input.setSelectionRange(start, end)
if (props.type === 'textarea') {
input.setSelectionRange(start, end)
}
}
}, [selectionRange.start, selectionRange.end])