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

[Toast] call Toast.hide immediately after Toast.loading is useless #242

Closed
Akimyou opened this issue Nov 27, 2018 · 3 comments
Closed

[Toast] call Toast.hide immediately after Toast.loading is useless #242

Akimyou opened this issue Nov 27, 2018 · 3 comments
Labels
bug Something isn't working @Components Components related

Comments

@Akimyou
Copy link

Akimyou commented Nov 27, 2018

Toast.hide 的行为有些异常,例如调用 Toast.loading 之后立即调用 Toast.hide 无效。

https://github.com/didi/mand-mobile/blob/master/components/popup/index.vue

在这里发现, this.isPopupBoxShow = true 在 hide 和 show 的处理不一致。
可能在 hide 函数中,也需要把 this.isPopupBoxShow = true 包在 nextTick 中。

Mand Mobile Version

1.5.2

OS Version & Browser Version

macOS 10.13.4 (17E199) & Chrome 70

Recurring Steps

this.$toast.loading('loading...')
this.$toast.hide()
setTimeout(() => {
  this.$toast.hide()
}, 1000)

Expectant Behaviors

toast is hide by this.$toast.hide()

Actual Behaviors

toast is hide util setTimeout

https://github.com/didi/mand-mobile/blob/master/components/popup/index.vue

    // MARK: private methods
    $_showPopupBox() {
      this.isPopupShow = true
      this.isAnimation = true
      // popup box enter the animation after popup show
      this.$nextTick(() => {
        this.isPopupBoxShow = true 
        /* istanbul ignore if */
        if (process.env.NODE_ENV === 'testing') {
          this.$_onPopupTransitionEnd()
        }
      })
      this.preventScroll && this.$_preventScroll(true)
    },
    $_hidePopupBox() {
      this.isAnimation = true
      this.isPopupBoxShow = false  // HERE: may be need wrap by this.$nextTick()
      this.preventScroll && this.$_preventScroll(false)
      this.$emit('input', false)
      /* istanbul ignore if */
      if (process.env.NODE_ENV === 'testing') {
        this.$_onPopupTransitionEnd()
      }
    },
@xxyan0205 xxyan0205 added bug Something isn't working @Components Components related labels Nov 28, 2018
@Akimyou
Copy link
Author

Akimyou commented Nov 30, 2018

这个问题打算什么时候发布呢,它正困扰着我们。

@duxinxiao
Copy link

@xxyan0205 你这个 commit 没有解决本质问题啊,出问题的组件是 popup,你只把 toast 改了

@xxyan0205
Copy link
Collaborator

这个问题打算什么时候发布呢,它正困扰着我们。

争取周一前

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

No branches or pull requests

3 participants