Skip to content

Commit ae6d1d8

Browse files
committed
Remove automatic text selection when focusing the prompt field in the use-handlers hook
- when placing 'hash sign' symbols, the cursor is correctly moved to the end of the placed symbol. That's not the case with 'at sign' - cursor is incorrectly moved to the very end of the text.
1 parent 6ce5959 commit ae6d1d8

1 file changed

Lines changed: 0 additions & 8 deletions

File tree

  • packages/ui/src/components/editor/panel/prompts/PromptField/hooks

‎packages/ui/src/components/editor/panel/prompts/PromptField/hooks/use-handlers.ts‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -128,14 +128,6 @@ export const use_handlers = (
128128
requestAnimationFrame(() => {
129129
if (!params.input_ref.current) return
130130
params.input_ref.current.focus({ preventScroll: true })
131-
const selection = window.getSelection()
132-
if (selection) {
133-
const range = document.createRange()
134-
range.selectNodeContents(params.input_ref.current)
135-
range.collapse(false)
136-
selection.removeAllRanges()
137-
selection.addRange(range)
138-
}
139131
})
140132
}
141133
}, [props.focus_key, props.missing_configuration])

0 commit comments

Comments
 (0)