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

🐛[BUG] 初始化一些聊天记录,嵌入到iframe中的滚动条会有问题,默认不能自动到最底部 #202

Open
nzmd opened this issue May 11, 2024 · 2 comments
Labels
help wanted Extra attention is needed

Comments

@nzmd
Copy link

nzmd commented May 11, 2024

🐛 bug 描述

1379d94e7b26e016275f9a754cd018d

使用chats加载聊天记录(需要含有非纯文本的内容,比如链接),嵌入到iframe中的滚动条会有问题,默认不能自动到最底部
不嵌入到iframe中是正常的

//使用 scrollToBottom 也不行 setShowComponent(true) try { setTimeout(() => { console.log('proChatRef.current',proChatRef.current) proChatRef.current.scrollToBottom?.(); }, 1500); } catch (error) { console.error(' proChatRef.current.scrollToBottom发生错误:', error); }

` return (
<div style={{ background: theme.colorBgLayout ,height:'95%',width:'100%'}}>

  {
    showComponent && <ProChatProvider
  // initialChats={example.chats}
  // initialChats={initialChats}
  chats={initialChats}
  chatRef={proChatRef}
  placeholder={placeholder}
  helloMessage={hello}
  actions={
    {
    render: (defaultDoms) => {
  const proChat = useProChat();
      return [`

📷 复现步骤

没有嵌入到iframe中是正常滚动到最底部的
e9897a7a0643234bfbe4ba7ad619bcc

🏞 期望结果

期望自动滚动到最底部

💻 复现代码

可复现 demo

© 版本信息

"@ant-design/pro-chat": "^1.13.6",

  • @ant-design/pro-chat 版本: [e.g. 1.0.0]
  • 浏览器环境
  • 开发环境 [e.g. mac OS]

🚑 其他信息

@songhanlin
Copy link

可能是高宽导致的, 可以尝试下调整iframe的高宽来看看, 我有一个页面嵌套的层级较多, 高宽自定义之后, 也会出现类似的情况.

@ONLY-yours
Copy link
Collaborator

demo 是不是有点问题,我这边没有看到有 ProChat 诶

@ONLY-yours ONLY-yours added the help wanted Extra attention is needed label May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants