Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 fix: 修复有些时候回到底部按钮不展示的问题 #175

Merged
merged 1 commit into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/BackBottom/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const BackBottom = (props: BackBottomProps) => {
}, []);

const current = useMemo(() => {
if (target.current && target.current.scrollHeight > target.current.clientHeight) {
if (target.current) {
return target.current;
}
return document.body;
Expand Down Expand Up @@ -98,7 +98,7 @@ const BackBottom = (props: BackBottomProps) => {
}, [current]);

useEffect(() => {
if (scroll?.top && !alwaysShow) {
if (!alwaysShow) {
setVisible(scroll?.top + clientHeight + visibilityHeight < scrollHeight);
}
}, [scrollHeight, scroll, visibilityHeight, current]);
Expand Down
2 changes: 1 addition & 1 deletion src/ProChat/container/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ const App = memo<ConversationProps>(
/>
{ref?.current && <ChatScrollAnchor target={ref} />}
</div>
{isRender ? (
{isRender && ref?.current ? (
<BackBottom
style={{
bottom: 138,
Expand Down
Loading