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 is not closing in andriod application. #142

Closed
svambati opened this issue Oct 29, 2020 · 9 comments
Closed

Toast is not closing in andriod application. #142

svambati opened this issue Oct 29, 2020 · 9 comments
Labels
need more info More information is needed to proceed Type: Bug Something isn't working

Comments

@svambati
Copy link

Versions

  • 1.0

Describe the bug

Toast is not closing automatically even though we have set timeout.

Expected behavior

Toast has to be closed after certain time.

Steps to reproduce

Reproduction demo.
Steps:

  1. Install normally
  2. Set up plugin
  3. ...

Your Environment

Andriod Phone - Cromium 33

Additional context

@svambati svambati added Status: Available Type: Bug Something isn't working labels Oct 29, 2020
@svambati
Copy link
Author

I see this is fixed in latest release in v2. But not sure whether it would be compatible with vue 2

@Maronato
Copy link
Owner

Maronato commented Oct 29, 2020

Hello @svambati!

Thank you for reporting this, but I'm afraid I've not been able to reproduce the issue.
I'm running Chrome 86 on Android 10 and both the demo and this codesandbox work fine on it.

The demo is still running v1.x and the codesandbox is running 1.7.8, so maybe the issue lies elsewhere.

Can you provide a way to reproduce your setup so I can help you debug it?

@Maronato Maronato added the need more info More information is needed to proceed label Oct 29, 2020
@cyberco
Copy link

cyberco commented Nov 8, 2020

I have the same problem in my Vue 3 + TypeScript application. The notification doesn't disappear.

@Abdulrahmanh995
Copy link

Abdulrahmanh995 commented Nov 10, 2020

@Maronato So do I, I'm working with Vue 3 JavaScript application and the toast is not closing automatically after timeout exceeds.

@Abdulrahmanh995
Copy link

@svambati @cyberco
For now, I'm just hacking around in order to make it work using a custom hook (composable):

export default function useToastr() {

function message(type, msg, options) {

    const toast = useToast();
    const toastId = toast[type](msg, options);
    
   setTimeout(() => {
        toast.dismiss(toastId);
    }, options.timeout || 5000);
}
function success(msg, options) {
    message('success', msg, options);
}

function error(msg, options) {
    message('error', msg, options);
}

return {
    error,
    success
}

}

@Maronato
Copy link
Owner

Maronato commented Nov 10, 2020

@cyberco @Abdulrahmanh95 which versions are you using (both Vue, Vue-toastification and browser)?

Also, are you able to setup a minimal repo or codesandbox in which the issue occurs?

I've not been able to reproduce it.

@Maronato
Copy link
Owner

Maronato commented Nov 10, 2020

Here is a codesandbox showing that the toasts do disappear with Vue 3.0.2 and Vue Toastification 2.0.0-beta.7:

Edit zealous-microservice-63l7k

CleanShot 2020-11-10 at 13 45 14

Please keep in mind that, because of a recent vue commit, there are some issues regarding mismatched versions of vue and its compiler that lead to kebab-case events not firing correctly(also here, here and here). Incidentaly, there has been a recent issue filled here on Vue Toastification that reported the same problem and, since then, only vue >=3.0.2 is supported.

Make sure that your Vue installation is up to date and report back if the issue persists. Take a look inside your package-lock and make sure that both vue and @vue/compiler-sfc are on ^3.0.2.

@svambati
Copy link
Author

@svambati @cyberco
For now, I'm just hacking around in order to make it work using a custom hook (composable):

export default function useToastr() {

function message(type, msg, options) {

    const toast = useToast();
    const toastId = toast[type](msg, options);
    
   setTimeout(() => {
        toast.dismiss(toastId);
    }, options.timeout || 5000);
}
function success(msg, options) {
    message('success', msg, options);
}

function error(msg, options) {
    message('error', msg, options);
}

return {
    error,
    success
}

}

@svambati svambati reopened this Nov 18, 2020
@Maronato
Copy link
Owner

Maronato commented Dec 3, 2020

Closing this since no reproduction steps have been provided and it really seems like a duplicate of #137

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need more info More information is needed to proceed Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants