Open White-Friday opened 1 year ago
I'm having this problem too, but I'm also having the list index out of range or whatever and I think I have my openai_api_base set wrong. Is it just suppose to be https://api.openai.com if I'm not using any proxy or anything? I can get it to respond with that set as the opan_api_base but I can't scroll down to see the full response.
@xtekky how to scroll the page?
In style.css I change this to this:
html,
body {
scroll-behavior: smooth;
overflow: auto;
}
then in chat.js I removed every instance of
message_box.scrollTop = message_box.scrollHeight;
and added this EventListener here:
const ask_gpt = async (message) => {
message_box.addEventListener('scroll', function () {
message_box.scrollTo({ top: message_box.scrollHeight, behavior: "smooth" });
});
try {
message_input.value = ``;
message_input.innerHTML = ``;
message_input.innerText = ``;`
This makes the page functional in that I can scroll down now and I can scroll down as the api is responding, but it's definitely not a proper fix. Hopefully someone comes along and does it properly, but for now this is working for me. I'm probably breaking something with this though, because IDK what I'm doing.
1 ) remove overflow from body and keep only html, body { scroll-behavior: smooth; }
2) open chat.js with any editor ! then press ctrl + h and remove all window.scrollTo(0, 0);
lines
optionally you can add
window.scrollTo(0, document.body.scrollHeight);
to automatically go to bottom page
exemple
message_input.addEventListener("blur", () => { window.scrollTo(0, document.body.scrollHeight); });
you can find updated files in my fork
you can find updated files in my fork
Yesterday after a couple of hours I resolved the issue both for PC and mobile. You can find changes in my pull request https://github.com/xtekky/chatgpt-clone/pull/89
Super appreciated!
When the front-end page is full, the complete information cannot be displayed through the pull-down