Skip to content

Commit 1584b62

Browse files
diwakarmk7ZuhairAhmed-cs
authored andcommitted
suggestion scroll movement fix
1 parent 07cb9f5 commit 1584b62

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/visualBuilder/hooks/useCommentTextArea.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,14 @@ export const useCommentTextArea = (
375375
]
376376
);
377377

378+
useEffect(() => {
379+
itemRefs.current[selectedIndex]?.scrollIntoView({
380+
behavior: "smooth",
381+
block: "nearest",
382+
inline: "nearest",
383+
});
384+
}, [selectedIndex]);
385+
378386
const handleSubmit = useCallback(async () => {
379387
if (error.hasError) return;
380388

0 commit comments

Comments
 (0)