Fix the chat scroll behavior for vertical screens.
Fetch the messages until the scrollbar becomes visible, so that the user always has the ability to scroll up and load new messages.
This commit is contained in:
parent
dbeecd18ac
commit
15ea9d8c91
3 changed files with 17 additions and 1 deletions
|
@ -24,3 +24,10 @@ export const isBottomedOut = (el, offset = 0) => {
|
|||
export const scrollableContainerHeight = (inner, header, footer) => {
|
||||
return inner.offsetHeight - header.clientHeight - footer.clientHeight
|
||||
}
|
||||
|
||||
// Returns whether or not the scrollbar is visible.
|
||||
export const isScrollable = (el) => {
|
||||
if (!el) return
|
||||
|
||||
return el.scrollHeight > el.clientHeight
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue