Skip to content
This repository was archived by the owner on Apr 15, 2026. It is now read-only.
This repository was archived by the owner on Apr 15, 2026. It is now read-only.

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

@Akimyou

Description

@Akimyou

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()
      }
    },

Metadata

Metadata

Assignees

No one assigned

    Labels

    @ComponentsComponents relatedbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions