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

sender 组件 LoadingButton 自定义Tooltip,源代码中的 stop loading 仍旧存在 #476

Open
gehuama opened this issue Jan 14, 2025 · 4 comments
Labels
bug Something isn't working

Comments

@gehuama
Copy link

gehuama commented Jan 14, 2025

重现步骤

在线示例链接:(必填)

步骤:
1.https://ant-design-x.antgroup.com/components/sender-cn#senderprops

  1. Click to cancel 与stop loading 同时存在

当前行为

No response

预期行为

此时应该自定义提示,stop loading不存在

上下文

No response

版本

v1.0.4

您在哪些浏览器上遇到了这个问题?

No response

@gehuama gehuama added the bug Something isn't working label Jan 14, 2025
Copy link

您提到在使用 sender 组件的 LoadingButton 时,自定义的 Tooltip 中仍然存在 "stop loading" 的提示。为了帮助您解决这个问题,我需要确认以下几点:

  1. 您是否已经在代码中尝试过自定义 Tooltip 的内容?
  2. 您能否提供一个最小可重现的代码示例,以便我更好地理解问题的具体情况?

如果您已经尝试过自定义 Tooltip,但问题仍然存在,可能需要查看组件的源码或相关配置,以确定是否有遗漏的地方。

如果您愿意,我可以帮助您查找相关的代码片段或问题报告,以便更快地解决问题。请告诉我您的具体需求。

🪧 Tips For further assistance, please describe your question in the comments and @petercat-assistant to start a conversation with me.

@gehuama
Copy link
Author

gehuama commented Jan 14, 2025

import React, { useState } from 'react';
import './index.css';
import { Sender } from '@ant-design/x';
import { App, Flex, Space, Tooltip } from 'antd';

const Demo: React.FC = () => {
const [value, setValue] = useState('Hello? this is X!');
const [loading, setLoading] = useState(false);

const { message } = App.useApp();

// Mock send message
React.useEffect(() => {
if (loading) {
const timer = setTimeout(() => {
setLoading(false);
message.success('Send message successfully!');
}, 3000);
return () => {
clearTimeout(timer);
};
}
}, [loading]);

return (

<Sender
loading={loading}
value={value}
onChange={(v) => {
setValue(v);
}}
onSubmit={() => {
setValue('');
setLoading(true);
message.info('Send message!');
}}
onCancel={() => {
setLoading(false);
message.error('Cancel sending!');
}}
/>
<Sender
value="Force as loading"
loading
readOnly
actions={(_, info) => {
const { SendButton, LoadingButton } = info.components;
return (

            <Tooltip title="重新生成">
              <LoadingButton type="default" />
            </Tooltip>
      );
    }}
  />
  <Sender disabled value="Set to disabled" />
</Flex>

);
};

export default () => (



);

@gehuama
Copy link
Author

gehuama commented Jan 14, 2025

Image

@YumoImer
Copy link
Collaborator

看了下,Stop Loading 这个提示是预设的 SVG title 标签提供的,我考虑下是否应该将其移除~

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants