vue-sonner icon indicating copy to clipboard operation
vue-sonner copied to clipboard

Bug: Can't create new toasts after dismiss

Open dewodt opened this issue 1 year ago • 5 comments

Enviroment

System: OS: Linux 6.5 Ubuntu 22.04.4 LTS 22.04.4 LTS (Jammy Jellyfish) CPU: (8) x64 Intel(R) Core(TM) i7-10510U CPU @ 1.80GHz Memory: 6.59 GB / 15.45 GB Container: Yes Shell: 5.8.1 - /usr/bin/zsh Binaries: Node: 21.7.1 - /usr/bin/node Yarn: 1.22.21 - /usr/bin/yarn npm: 10.4.0 - /usr/local/bin/npm pnpm: 8.15.4 - /usr/bin/pnpm bun: 1.0.25 - ~/.bun/bin/bun Browsers: Chrome: 122.0.6261.111

Dependencies:

{
  "dependencies": {
    "vue": "^3.4.15",
    "vue-router": "^4.2.5",
    "vue-sonner": "^1.1.2"
  },
  "devDependencies": {
    "@rushstack/eslint-patch": "^1.3.3",
    "@tsconfig/node20": "^20.1.2",
    "@types/node": "^20.11.10",
    "@vitejs/plugin-vue": "^5.0.3",
    "@vue/eslint-config-prettier": "^8.0.0",
    "@vue/eslint-config-typescript": "^12.0.0",
    "@vue/tsconfig": "^0.5.1",
    "eslint": "^8.49.0",
    "eslint-plugin-vue": "^9.17.0",
    "npm-run-all2": "^6.1.1",
    "prettier": "^3.0.3",
    "typescript": "~5.3.0",
    "vite": "^5.0.11",
    "vue-tsc": "^1.8.27"
  }
}

Issue

Cannot create a new toasts after dismissing a toasts.

Expected Behavior:

Calling a new toasts should appear even after dismissing a toasts. Atleast it works this way in emilkowalski's sonner library.

Example:

<script setup lang="ts">
import { Toaster, toast } from 'vue-sonner'
const handleClick = async () => {
  // Show a toast
  const loadingToast = toast.loading('Loading...')

  // Simulate an API call
  await new Promise((resolve) => setTimeout(resolve, 4000))

  // Dismiss the toasts
  toast.dismiss(loadingToast)

  // Show a success toast
  // ERROR: NOT SHOWING
  toast.success('Success!')
}
</script>

<template>
  <button @click="handleClick">Tes</button>
  <Toaster />
</template>

Demo

vue-sonner-demo.webm

Logs

image

dewodt avatar Mar 10 '24 03:03 dewodt

Same @xiaoluoboding please see this

ishaiavrahami avatar Apr 01 '24 05:04 ishaiavrahami

@dewodt did you find an answer?

ishaiavrahami avatar Apr 01 '24 05:04 ishaiavrahami

@dewodt did you find an answer?

Not yet, I haven't got time to find the bug in the source code.

dewodt avatar Apr 02 '24 02:04 dewodt

Same issue

zk118 avatar Jul 23 '24 13:07 zk118

THE SAME

maksym-arturIn avatar Oct 25 '24 09:10 maksym-arturIn