Commit 27110f11 by HoMeTown

feat: 平滑滚动

parent f9032e3b
......@@ -120,7 +120,8 @@ export const Chat: React.FC = () => {
}, [shouldSendQuestion])
const scrollToBottom = () => {
scrollableRef.current.scrollTop = scrollableRef.current.scrollHeight
// scrollableRef.current.scrollTop = scrollableRef.current.scrollHeight
scrollableRef.current.scrollTo(scrollableRef.current.scrollHeight, { behavior: 'smooth' })
}
useEffect(() => {
......@@ -150,7 +151,7 @@ export const Chat: React.FC = () => {
duration: 0.3,
opacity: { duration: 0.1 },
}}
className={`${styles.scrollable} scrollbar-hide`}
className={`${styles.scrollable} scrollbar-hide scroll-smooth`}
>
<div className={styles.inter}>
{allItems.map((record, index) => (
......
......@@ -11,7 +11,7 @@ interface ChatAnswerShowerProps {
}
export const ChatAnswerShower: React.FC<ChatAnswerShowerProps> = ({ answer, isLastAnswer, onSubmitQuestion }) => {
const hideOperate = answer.attachmentList.some(attachment => attachment.type === 'box')
const hideOperate = (answer.attachmentList || []).some(attachment => attachment.type === 'box')
return (
<div className="answerShower">
{answer.answer && (
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment