MCPcopy Create free account
hub / github.com/Detaysoft/react-chat-elements / checkScroll

Function checkScroll

src/MessageList/MessageList.tsx:21–32  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

19 const prevProps = useRef(props)
20
21 const checkScroll = () => {
22 var e = referance
23 if (!e || !e.current) return
24
25 if (toBottomHeight === '100%' || (toBottomHeight && scrollBottom < toBottomHeight)) {
26 e.current.scrollTop = e.current.scrollHeight // scroll to bottom
27 } else {
28 if (lockable === true) {
29 e.current.scrollTop = e.current.scrollHeight - e.current.offsetHeight - scrollBottom
30 }
31 }
32 }
33
34 useEffect(() => {
35 if (!referance) return

Callers 1

MessageListFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…