-
Notifications
You must be signed in to change notification settings - Fork 110
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
使用Upload组件,限制最大数量存在BUG #440
Labels
Comments
👋 @q920447939,感谢给 TDesign 提出了 issue。 |
感谢,晚点我写个测试页面看一下。
我理解这个需求,当上传数量超过max的阈值时,需要提供一个Toast提示,是这样吗? |
是这个意思。但是我觉得可以更加通用一点,Toast 可以允许用户来实现 |
这个 Issue 被标记为了过时 stale ,因为它已经持续 30 天没有任何活动了。删除 stale 标签或评论,否则将在 7 天内关闭。 |
This was referenced Feb 7, 2025
下个版本会支持Toast提示,为Upload组件新增了一个 下面是个简单示例: final List<TDUploadFile> files1 = [
TDUploadFile(key: 1, remotePath: 'https://tdesign.gtimg.com/demo/images/example1.png'),
TDUploadFile(key: 2, remotePath: 'https://tdesign.gtimg.com/demo/images/example2.png'),
TDUploadFile(key: 3, remotePath: 'https://tdesign.gtimg.com/demo/images/example3.png'),
];
void tips() {
TDToast.showIconText('选择的图片数量超过最大限制', icon: TDIcons.chat_error, context: context);
}
TDUpload(
files: files1,
multiple: true,
max: 1,
onClick: onClick,
onCancel: onCancel,
onError: print,
onValidate: print,
onMaxLimitReached: tips,
onChange: ((files, type) => onValueChanged(files1, files, type)),
)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
tdesign-flutter 版本
0.1.8
重现链接
https://github.com/Tencent/tdesign-flutter/tree/main/tdesign-component/example
重现步骤
Upload中有一个属性是 max ,用来限制最大数量。
比如 max 填入3
如果在选择时,选择超过3张照片以上 ,那么直接报错
期望结果
选择的图片数量大于max, 应该不可以再选择图片或者对用户提示选择的数量超过max数量(但是如果给予i提示的话,那么对用户的体验来说不友好)
实际结果
报错
Flutter版本
3.24.4
设备与机型信息
Android
系统版本
emulator
补充说明
使用example 工程,应该可以复现。
IssueShoot
The text was updated successfully, but these errors were encountered: