mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2025-12-06 07:12:10 +01:00
Fix the instruct message height on mobile
This commit is contained in:
parent
c6ea67bbdb
commit
2395c647d4
|
|
@ -206,7 +206,13 @@ const observer = new MutationObserver(function(mutations) {
|
||||||
// Add padding to the messages container to create room for the last message.
|
// Add padding to the messages container to create room for the last message.
|
||||||
// The purpose of this is to avoid constant scrolling during streaming in
|
// The purpose of this is to avoid constant scrolling during streaming in
|
||||||
// instruct mode.
|
// instruct mode.
|
||||||
const bufferHeight = Math.max(0, Math.max(window.innerHeight - 128 - 84, window.innerHeight - prevSibling.offsetHeight - 84) - lastChild.offsetHeight);
|
let bufferHeight = Math.max(0, Math.max(window.innerHeight - 128 - 84, window.innerHeight - prevSibling.offsetHeight - 84) - lastChild.offsetHeight);
|
||||||
|
|
||||||
|
// Subtract header height when screen width is <= 924px
|
||||||
|
if (window.innerWidth <= 924) {
|
||||||
|
bufferHeight = Math.max(0, bufferHeight - 32);
|
||||||
|
}
|
||||||
|
|
||||||
messagesContainer.style.paddingBottom = `${bufferHeight}px`;
|
messagesContainer.style.paddingBottom = `${bufferHeight}px`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue