mirror of
https://github.com/arc53/DocsGPT.git
synced 2025-11-30 00:53:14 +00:00
fix(conv): scroll btn; css clean up
This commit is contained in:
@@ -182,12 +182,19 @@ export default function Conversation() {
|
||||
)}px`;
|
||||
}
|
||||
};
|
||||
|
||||
const checkScroll = () => {
|
||||
const el = conversationRef.current;
|
||||
if (!el) return;
|
||||
const isBottom = el.scrollHeight - el.scrollTop - el.clientHeight < 10;
|
||||
setHasScrolledToLast(isBottom);
|
||||
};
|
||||
useEffect(() => {
|
||||
handleInput();
|
||||
window.addEventListener('resize', handleInput);
|
||||
conversationRef.current?.addEventListener('scroll', checkScroll);
|
||||
return () => {
|
||||
window.removeEventListener('resize', handleInput);
|
||||
conversationRef.current?.removeEventListener('scroll', checkScroll);
|
||||
};
|
||||
}, []);
|
||||
return (
|
||||
|
||||
@@ -2,6 +2,16 @@
|
||||
@tailwind components;
|
||||
@tailwind utilities;
|
||||
|
||||
:root {
|
||||
--viewport-height: 100vh;
|
||||
}
|
||||
|
||||
@supports (height: 100dvh) {
|
||||
:root {
|
||||
--viewport-height: 100dvh; /* Use dvh where supported */
|
||||
}
|
||||
}
|
||||
|
||||
body.dark {
|
||||
background-color: #202124; /* raisin-black */
|
||||
}
|
||||
@@ -63,20 +73,19 @@ html {
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
min-height: 100vh;
|
||||
min-height: var(--viewport-height);
|
||||
overflow-x: hidden;
|
||||
font-family: 'Inter', sans-serif;
|
||||
}
|
||||
/*
|
||||
Avoid changing height in mobile browsers
|
||||
Avoid over-scrolling in mobile browsers
|
||||
*/
|
||||
@media only screen and (max-width: 500px) {
|
||||
body,
|
||||
html {
|
||||
height: 100%;
|
||||
min-height: var(--viewport-height);
|
||||
position: fixed;
|
||||
width: 100%;
|
||||
overflow-y: none;
|
||||
}
|
||||
}
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user