question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Toast has different width during appearing

See original GitHub issue

Description

I run Materialize.toast(message, 4000);, where message is a long string (50 symbols). Toast appears on the screen. For a very short time toast is a little wider then necessary. Then toast width become normal. It is not beautiful, so I expect that toast should have the same width all time.

Repro Steps

http://codepen.io/dima74/pen/MpXwPN In this codepen I print toast width immediately after toast appears, and after one second. I received: 375px and 320px.

Screenshots / Codepen

Please, watch these video in slowmotion mode (speed 0.25): https://youtu.be/SGhrD1fCj9A

Here is screenshots from video. They show, that toasts have different width. image image

I use Chrome 57 on linux. Thank you for materialize, thank if answer something!

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
dima74commented, Apr 29, 2017

I realized the problem. If I show toast in the beggining of the page loads, when fonts doesn’t load yet, then toast text will have default browser font (DejaVu Sans Light in my case). And DejaVu Sans Light is a little more then Roboto Light (which is default Materialize font), so toast will have a little more width while appearing, until Roboto Light font loads. I think nothing can be done with this. Anyway, thanks for helping!

0reactions
dima74commented, Apr 29, 2017

OK, thank you

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to adjust toaster popup width - Stack Overflow
I saw that toaster has a parameter 'position-class' to change the position and even the width of the popup, like for example 'toast-top-full-width',...
Read more >
Toasts - Lightning Design System
The width of a toast is determined by the length of its content and its inside padding, but at minimum it should be...
Read more >
Configuring options in JavaScript Toast control - Syncfusion
Width and height. The dimensions of the toast can be set using the width and height properties. This will individually set all toasts....
Read more >
Toasts · Bootstrap v5.0
Toasts are lightweight notifications designed to mimic the push notifications that have been popularized by mobile and desktop operating systems.
Read more >
Designing Toast Messages for Accessibility
A toast is a non-modal dialog that appears and disappears in the span of a few seconds. It may also optionally have a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found