react-flip-toolkit icon indicating copy to clipboard operation
react-flip-toolkit copied to clipboard

Prevent element being followed by scrolling in Chrome

Open arichter83 opened this issue 6 years ago • 2 comments

I have a list of elements longer than the viewport. When the user interacts with an element below the fold and this one is reordered above the fold, the viewport is scrolled upwards to follow the element. How can I prevent this?

I tried the following in the event, but document.activeElement is only body :

      if ("activeElement" in document) {
          document.activeElement.blur()
      }

Any ideas?

arichter83 avatar Mar 25 '19 10:03 arichter83

I'm experiencing the same thing in Firefox. Have you found a solution yet? I made a code sample reproducing the issue: https://codesandbox.io/s/react-flip-toolkit-unexpected-scrolling-eo621

https://user-images.githubusercontent.com/4968522/102698407-f99f3980-420a-11eb-84f6-9e42dcd1c954.mov

nerdydrew avatar Dec 19 '20 20:12 nerdydrew

It woud be awesome to have at least a hack to avoid this

DT3264 avatar Sep 19 '23 17:09 DT3264