'Unable to scroll to textarea on Android Chrome in React app

Upon clicking the textarea, half of it is blocked when the Android Chrome keyboard popups up. And the code snippets below don't work in scrolling the screen to the top of the textarea. I've also tried the scroll-to-component react library. How can I make this work?

this.textareaRef.current.scrollIntoView({
  behavior: "smooth",
  block: "start"
});

//another nonworking solution
let node = ReactDOM.findDOMNode(this.textareaRef.current);
node.scrollIntoView({ block: "start", behavior: "smooth" });

//nonworking scroll-to-component usage
scrollToComponent(this.textareaRef.name);

Before:

After:



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source