-
Notifications
You must be signed in to change notification settings - Fork 191
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
How do you show a toast message? #963
Comments
I found the API tab :P and I'm able to show it by adding the toast to the page:
And I have a button that toggles the view:
A few things, 1). the padding and margins seem to be off: I looked in the CSS and web tools shows that CSS variables are not set: I'm guessing this is probably related to how I'm using it from a CDN. 2). how do I make the toast slide or fade in from the bottom of the screen like I've seen in some apps? 3). How do I have it hidden initially. I've set display to none but then 4). Is there an
|
Once you have a reference to an alert element, the intended API is to leverage
|
I've been working on more examples and there are a few issues I run into. The CSS variables are not set and that some elements (usually pop ups) aren't positioned correctly. They are locked to the upper left of the screen. Here is the test page I'm using. Pop up placement:
Toast element with no padding (CSS variables not applied):
|
For the overlay positioning, it looks like JSPM is not removing Node.JS code in their processing of packages, so you can either use this in your page:
Or you can actually use a local build, which you'll need anyways for an actual production deployment. This is something that we've brought up a number of times with the 3rd party library we use that publishes it's code requiring these values, but we've not had a lot of luck getting them to change. For
Overrides the default styling of the element. Take that out and you're good to go. |
Yay! The pop up menus are working for my page and the toast element too. :) Is there a way to restore padding specifically for sp-toast? It looks like I can set the default padding using:
But it looks like there are other elements like popover that will require style declarations too? If the padding comes from the default browser styles then should there be defaults defined with higher specificity? Or is my global style declaration overriding Spectrum defaults? Global is the most generic low priority correct? I can submit a new issue. Are they here on site here? |
The padding is set as required in compliance with Spectrum design on all of the A new issue on that project would be great. I'll also revisit their recent releases to see if there are other options for us to consume their code by. |
I posted but they said it was not their issue. Is there something else I can mention? Here is the link
|
I'm taking another path on the possibility of having more optimized build delivered from Popper here: floating-ui/floating-ui#1188 I'm going to close this issue as not having follow up actions. Please feel free to open more specific issues as you continue your use of the library. |
Between #996 and floating-ui/floating-ui#1191 hopefully the overlay situation will also be cleared up here! |
How do you show a toast message? Is there an
alert.show()
oralert.hide()
API?I'm looking at the documentation here.
https://opensource.adobe.com/spectrum-web-components/components/toast
I can see how to create the UI of one using the code:
<sp-toast>This is important information that you should read, soon.</sp-toast>
The text was updated successfully, but these errors were encountered: