简体   繁体   中英

scrollTop = scrollHeight not working on Safari

I'm using divRef.current.scrollTop = divRef.current.scrollHeight in my react application to scroll to end of the scrollable div. it's working as expected in chrome but it's not working on safari.

divRef.current.scrollTop = divRef.current.scrollHeight

我还通过添加这一行来解决它:

divRef.current.scrollIntoView(false);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM