Skip to content

Snackbar immediately closes if duration is above 1e+21 #17234

@bagage

Description

@bagage

Reproduction

Use StackBlitz to reproduce your issue: https://stackblitz.com/fork/components-issue

Steps to reproduce:

  1. Open https://stackblitz.com/angular/jrnynrjaqdo
  2. Display a snackbar with duration durationInSeconds = 1e+21; or Number.MAX_VALUE
  3. Launch the snackbar

Expected Behavior

What behavior were you expecting to see?

The snackbar should be displayed for a (very) long time.

Actual Behavior

What behavior did you actually see?

Snackbar automatically closes itself after ~300ms.

It seems snackbar doesn't handle numbers with e format starting at e+21, eg it supports 1+e10 but not 1+e21 or above.

Environment

  • Angular: 8.2.8
  • CDK/Material: 8.2.1
  • Browser(s): chrome
  • Operating System (e.g. Windows, macOS, Ubuntu): ubuntu

Metadata

Metadata

Assignees

Labels

P4A relatively minor issue that is not relevant to core functions

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions