react-use-draggable-scroll icon indicating copy to clipboard operation
react-use-draggable-scroll copied to clipboard

Question: How to scrollIntoView?

Open vanniekerkalex opened this issue 2 years ago • 0 comments

Hi,

This is a question, not really an issue.

I have a div with a fixed size that allows the user to scroll / drag like a map. The map contains a floor plan with different rooms / elements. There are some rooms that will not be on-screen as they are scrolled / dragged out of view.

How can I have those elements be scrolled into view automatically when selected for say a dropdown list?

I have tried selectedElement.scrollIntoView(true), this works when view on a computer, but does not work on a mobile device.

I have also tried this method: http://jsfiddle.net/p3kar5bb/322/

Thanks in advance.

Br, Alex

vanniekerkalex avatar Jul 11 '23 11:07 vanniekerkalex