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

vue-toasted width #176

Open
LittleHChen opened this issue Aug 14, 2020 · 3 comments
Open

vue-toasted width #176

LittleHChen opened this issue Aug 14, 2020 · 3 comments

Comments

@LittleHChen
Copy link

LittleHChen commented Aug 14, 2020

Thanks for looking into this issue and sorry my poor english
The problem is that the vue-toasted width will be change if i change the content, but the last one has not disappeared
like this:
image
How can we solve this problem?
thanks!

@blahmonkey
Copy link

Same issue here. Each toast should be independent of the others.

While the toast main div has width: auto - when 2 toasts are visible, the width of both is kept the same, even if one has lower width content.

@mateeni-dev
Copy link

mateeni-dev commented Nov 26, 2020

Hi, I have a similar issue.

I have a global full-width toast with duration: 0, and a default toast accessible as $toasted.error(...) on same page.
Global toast is always visible.
Default toast is triggered on errors which remains for 5 seconds.

Problem is that when default toast is triggered:

  • my global toast is no longer full width and moves to the top right position.
  • my default toast is same width as global toast even though it has less content.

I was really surprised to see this as I imagined a global toast would be independent of every other toast.

Can this behavior be changed?
Is there any temporary solution to fix this quickly?

EDIT:
I found out that a fix is available already ==> $toasted.group. I had to look around a bit to figure it out as this is not documented anywhere, so would be nice if it is in future.

For anyone who is looking for a solution, this is what I did to trigger a standalone toast that retains its width, position and other settings while a second toast (default) is triggered with default settings:

// create standalone toast
const full_width_toast = this.$toasted.group({
        fullWidth: true,
        fitToScreen: true,
        duration: 0
});
// trigger
full_width_toast.success("Standalone toast msg")
// clear
full_width_toast.clear()

@EricRabil
Copy link

This fixed it for me. You could remove the align-items: center; if you don't need it to be centered.

.toasted-container {
  align-items: center;
}

.toasted {
  width: fit-content;
}

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