♻️ (builder) Remove barrel export and flatten folder arch
This commit is contained in:
12
apps/builder/src/helpers/focusInput.ts
Normal file
12
apps/builder/src/helpers/focusInput.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
type Props = {
|
||||
at: number
|
||||
input?: HTMLInputElement | HTMLTextAreaElement | null
|
||||
}
|
||||
|
||||
export const focusInput = ({ at, input }: Props) => {
|
||||
if (!input) return
|
||||
input.focus()
|
||||
setTimeout(() => {
|
||||
input.selectionStart = input.selectionEnd = at
|
||||
}, 100)
|
||||
}
|
||||
Reference in New Issue
Block a user