-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Toast设置duration为0时,手动隐藏不好使 #745
Comments
内存里面只保留了对最新的Toast实例的引用,所以你调用 @weiq 对于你的需求,应该写成这样
@silentcloud 是不是可以考虑改下Api的设计,类似这样
|
实际业务中用到的情况,一般页面中都只是有一个 toast 当前在显示中,应该很难看到两个 toast 同时显示吧,第二种方式在使用中还要保存引用实例,用起来略显麻烦; |
@paranoidjk @silentcloud 很多时候会有同时发多个ajax时,在请求前loading提示的并发问题,不可能按顺序隐藏。
下面这种方式可以满足要求
|
从移动端的场景来看,实际上一个页面的确不太可能同时两个Toast @silentcloud 另一种方案,或者把Toast做成单例?每次调用都销毁/覆盖之前的? |
@paranoidjk 恩,这个方案可行,也不会存在兼容性改动,我稍后改一下 |
@silentcloud 💯 忙的话也可以assign给我,你来review |
This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread. |
Toast设置duration为0时,手动隐藏不好使。
如果只有一个Toast提示时可以隐藏,如果有两个的时候最先出来的Toast隐藏不了。
示例:
https://codepen.io/weiq/pen/NddyXw?editors=0010
The text was updated successfully, but these errors were encountered: