-
Notifications
You must be signed in to change notification settings - Fork 687
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]: Toasts don't fallback to DEFAULT_TIMEOUT #2981
Comments
Hi @brendanfalkowski. Thank you for your report. Please, add a comment to assign the issue:
|
@magento I am working on this |
Yea, the docs indicate the prop is optional. And the code reads like it should function without it. I'm curious what the error is. Edit: I threw a toast into
Adding |
@sirugh Hmm, that seems to just trade Ideally, the mental footprint to use it should be low so it's just We ended up modifying this to fit the behavior of this pattern in our M1 site to support a |
@brendanfalkowski maybe :D I wrote this stuff almost two years ago and I've slept very little since then so we're in the same boat. At some point it might be worth it for us to clean up the toast implementation. For now, I think we can just accept your PR as is. Also, sorry about the spam on this issue - we're trying to figure something out with our jira-github sync tool. |
✅ Jira ticket "PWA-1382" is successfully created for this issue. |
@sirugh I hear you. I wrote myself the |
Co-authored-by: Devagouda <40405790+dpatil-magento@users.noreply.github.com>
Co-authored-by: Devagouda <40405790+dpatil-magento@users.noreply.github.com>
* [feature]: Basic desktop improvements for Venia - Mega Menu #2805 * added GraphQL query for Mega menu * added useMegaMenu talon * added MegaMenu component * added MegaMenuItem component * added Submenu component * added SubmenuColumn component * added MegaMenu to Header * added styles for Mega Menu * modified styles for header * Added improvements for MegaMenu * Update prettier config (#2900) Co-authored-by: Devagouda <40405790+dpatil-magento@users.noreply.github.com> * #2981: let DEFAULT_TIMEOUT for Toasts be used (#2982) Co-authored-by: Devagouda <40405790+dpatil-magento@users.noreply.github.com> * - Version bumps (#2983) - Remove comment causing deprecation warning - Fix test that was mocking the filesystem causing upstream deps to fail Co-authored-by: Devagouda <40405790+dpatil-magento@users.noreply.github.com> * Visual adjustements for mega menu * Mega menu - CR fixes * Fixed mega menu initial state if cache data does not exist * A few fixes - unset active category on home/search use callbacks vs inline functions fixed some comments and prop ordering Signed-off-by: sirugh <rugh@adobe.com> * Handle null or empty url suffix Signed-off-by: sirugh <rugh@adobe.com> * forgot one Signed-off-by: sirugh <rugh@adobe.com> Co-authored-by: Piyush Dankhra <dankhrapiyush@gmail.com> Co-authored-by: Devagouda <40405790+dpatil-magento@users.noreply.github.com> Co-authored-by: Brendan Falkowski <brendan@gravitydept.com> Co-authored-by: Tommy Wiebell <twiebell@adobe.com> Co-authored-by: sirugh <rugh@adobe.com>
Describe the bug
The
useToasts
hook appears to support a DEFAULT_TIMEOUT but the way it's implemented it can't be used.You shouldn't need to specify the timeout every time a Toast is added.
To reproduce
Steps to reproduce the behavior:
timeout
propExpected behavior
The Toast should timeout after the DEFAULT_TIMEOUT value specified in the hook.
What Actually Happens
Not passing
timeout
results in a TypeError. This means that every instance adding a Toast must specify the value which is bad for consistency.Possible solutions
I will PR a fix shortly.
Please let us know what packages this bug is in regards to:
venia-concept
venia-ui
pwa-buildpack
peregrine
pwa-devdocs
upward-js
upward-spec
create-pwa
The text was updated successfully, but these errors were encountered: