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

Change the default toast duration #28185

Closed
vanillajonathan opened this issue Feb 6, 2019 · 4 comments · Fixed by #31109
Closed

Change the default toast duration #28185

vanillajonathan opened this issue Feb 6, 2019 · 4 comments · Fixed by #31109
Labels

Comments

@vanillajonathan
Copy link
Contributor

The default toast duration is 500 milliseconds.

I would argue that this duration is too short which leads to the toast often disappearing before user can fully read the toast message.

I argue in favor of raising the default toast duration.

Android also have the concept of toasts and provides two constants. SHORT_DELAY at 2000 ms and LONG_DELAY at 3500 ms.

@Johann-S
Copy link
Member

Johann-S commented Feb 6, 2019

Hi @vanillajonathan,

You can override that by passing options when you create your toasts for example:

$('#yourToast').toast({
  delay: 2000
})

But you're right on one thing, we should be able to change the default options of our Toast plugin, to allow you to change that for all of your toasts 🤔

@Johann-S Johann-S changed the title Change the default toast duration Allow to change default config for Toasts Feb 6, 2019
@Johann-S
Copy link
Member

Johann-S commented Feb 6, 2019

@vanillajonathan #28186 merged so in our next release you'll be able to do:

bootstrap.Toast.Default.delay = 2000

And it'll be the default delay for all of your toasts 😉

@vanillajonathan
Copy link
Contributor Author

Yes, I am aware that the duration can be changed by passing in options. My point was that the default duration is too short.

Also my request is not for the introduction of a variable or property to define the default duration, but for the Bootstrap project to consider increasing the default duration.

@XhmikosR XhmikosR reopened this Feb 6, 2019
@Johann-S Johann-S changed the title Allow to change default config for Toasts Change the default toast duration Feb 6, 2019
@vanillajonathan
Copy link
Contributor Author

Android have constants for a long and a short duration, they are 4 seconds for the short toast and 7 seconds for the long toast.

These might be well thought out (or not?) durations backed by UX research.

https://github.com/aosp-mirror/platform_frameworks_base/blob/android10-release/core/java/android/widget/Toast.java#L384

static final long SHORT_DURATION_TIMEOUT = 4000;
static final long LONG_DURATION_TIMEOUT = 7000;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants