Why animateScroll from react-scroll package doesn't work in my electron App? ScrollBounce set to true for BrowserWindow, here the component
import { css, cx } from "emotion";
import { animateScroll } from "react-scroll";
import {
ChatModel,
} from "domain/index";
import { useSelector } from "react-redux";
import { messageMapSelector } from "redux-layer/selectors";
import Message from "components/content-message";
const ChatView = ({ className, chat }) => {
const messageMap = useSelector(messageMapSelector);
useEffect(() => {
animateScroll.scrollToBottom({
containerId: "ContainerElementID"
});
}, [chat]);
return (
<div id="ContainerElementID">
{chat.id
? (messageMap.get(chat.id) || []).map((message) => (
<Message
data={message}
key={message.id}
/>
))
: null}
</div>
);
};
export default ChatView;
Expected behavior: chat view should scroll down to the last message after chat populated or new messages come
Actual behavior: nothing happen when chat property updated and animateScroll.scrollToBottom fired in use effect