Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sdream-ai-fe
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
侯明涛
sdream-ai-fe
Commits
27110f11
Commit
27110f11
authored
Aug 15, 2024
by
HoMeTown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 平滑滚动
parent
f9032e3b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
src/pages/Chat/Chat.tsx
+3
-2
src/pages/Chat/components/ChatItem/ChatAnswerShower.tsx
+1
-1
No files found.
src/pages/Chat/Chat.tsx
View file @
27110f11
...
...
@@ -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
)
=>
(
...
...
src/pages/Chat/components/ChatItem/ChatAnswerShower.tsx
View file @
27110f11
...
...
@@ -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
&&
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment