pro-chat icon indicating copy to clipboard operation
pro-chat copied to clipboard

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

Open nzmd opened this issue 9 months ago • 2 comments

🐛 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]

🚑 其他信息

nzmd avatar May 11 '24 09:05 nzmd

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

songhanlin avatar May 16 '24 07:05 songhanlin

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

ONLY-yours avatar May 22 '24 07:05 ONLY-yours