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

Bug: Can't create new toasts after dismiss #60

Open
dewodt opened this issue Mar 10, 2024 · 5 comments
Open

Bug: Can't create new toasts after dismiss #60

dewodt opened this issue Mar 10, 2024 · 5 comments

Comments

@dewodt
Copy link

dewodt commented Mar 10, 2024

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

@ishaiavrahami
Copy link

Same @xiaoluoboding please see this

@ishaiavrahami
Copy link

@dewodt did you find an answer?

@dewodt
Copy link
Author

dewodt commented Apr 2, 2024

@dewodt did you find an answer?

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

@zk118
Copy link

zk118 commented Jul 23, 2024

Same issue

@maksym-arturIn
Copy link

THE SAME

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants