Skip to content

Commit

Permalink
fix(core): focus annotation popover first input
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrobonamin committed Oct 7, 2024
1 parent 2837d08 commit 18efbe9
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,13 @@ function Content(props: PopoverEditDialogProps) {
const [contentElement, setContentElement] = useState<HTMLDivElement | null>(null)
const containerElement = useRef<HTMLDivElement | null>(null)

useEffect(() => {
// When rendered, focus on the first input element in the content
if (contentElement) {
contentElement.querySelector('input')?.focus()
}
}, [contentElement])

return (
<VirtualizerScrollInstanceProvider
scrollElement={contentElement}
Expand Down

0 comments on commit 18efbe9

Please sign in to comment.