-
Notifications
You must be signed in to change notification settings - Fork 144
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
v2.0.0-beta.5 Toast not dismissing after timeout #137
Comments
I can confirm the bug on vue@3.0.2 + vue-toastification@2.0.0-beta.5 |
I can confirm the bug on vue@3.0.0 + vue-toastification@2.0.0-beta.5 |
Hello! I've done some digging and found that the issue seems to come from this commit on Here is an example from the Template Explorer showing how, before the change, the following template <div @close-toast="doStuff">Hello World!</div> Would get compiled to: export function render(_ctx, _cache, $props, $setup, $data, $options) {
return (_openBlock(), _createBlock("div", { "onClose-toast": _ctx.doStuff }, "Hello World!", 40 /* PROPS, HYDRATE_EVENTS */, ["onClose-toast"]))
} In fact, Vue-Toastification's typeof _ctx.content === 'string')
? (openBlock(), createBlock(Fragment, { key: 0 }, [
createTextVNode(toDisplayString(_ctx.content), 1 /* TEXT */)
], 64 /* STABLE_FRAGMENT */))
: (openBlock(), createBlock(resolveDynamicComponent(_ctx.getVueComponentFromObj(_ctx.content)), mergeProps({
key: 1,
"toast-id": _ctx.id
}, _ctx.content.props, toHandlers(_ctx.content.listeners), { "onClose-toast": _ctx.closeToast }), null, 16 /* FULL_PROPS */, ["toast-id", "onClose-toast"]))
], 10 /* CLASS, PROPS */, ["role"]), After the change, however, a handler for The same template as above now gets compiled to: export function render(_ctx, _cache, $props, $setup, $data, $options) {
return (_openBlock(), _createBlock("div", { onCloseToast: _ctx.doStuff }, "Hello World!", 40 /* PROPS, HYDRATE_EVENTS */, ["onCloseToast"]))
} The fix, then, should be as simple as recompiling the library using the newest version of I'll create a PR and push these changes into the next release, so please give it a try. |
@J-T-McC The issue seems to be fixed now. Please try it out :) |
Thanks @Maronato, all good now. |
Versions
v2.0.0-beta.5
Describe the bug
Toast is not dismissed after the timeout expires even though the timeoutHandler test is passing. Changing the event listeners to camel case in VtToast.vue makes the dismiss work but the timeoutHandler test no longer passes while "emits close-toast on animationend" does. Changing the event to single word (i.e. 'dismiss') throughout and all tests + timeout dismiss works
Expected behavior
Toast dismissed after timeout expires
Steps to reproduce
add v2.0.0-beta.5 package
Reproduction: demo.
Steps:
Your Environment
VueJS 3.0.1
Latest Chrome
The text was updated successfully, but these errors were encountered: