ant-design/pro-chat

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

Aperta

#202 aperta il 11 mag 2024

 (2 commenti) (0 reazioni) (0 assegnatari)TypeScript (117 fork)github user discovery
help wanted

Metriche repository

Star
 (899 stelle)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

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

🚑 其他信息

Guida contributor