Material-ui: [Snackbar] Action disappears if message is too long

Created on 7 Jan 2016  路  4Comments  路  Source: mui-org/material-ui

The snackbar's action seems to disappear when a message is long.

bug 馃悰 Snackbar

Most helpful comment

If you are using it in normal web-app(not mobile-app), this should work:

      <Snackbar
        style={{ pointerEvents: 'none', whiteSpace: 'nowrap' }}
        bodyStyle={{ pointerEvents: 'initial', maxWidth: 'none' }}
      />

All 4 comments

how long? if it is too long you may consider using other component instead of snackbar. MD specs said

Very short text strings

Snackbars should contain a single line of text directly related to the operation performed. They may contain a text action. They cannot contain icons.

@zachguo is correct, but it's still undesirable for the button to disappear when the text is longer than the available space, particularly on mobile, since multi-line layouts aren't currently supported.

The text truncates at a word boundary, but only when it overflows the div that contains it and the FlatButton, rather than leaving room for the button.

@oliviertassinari - multiline layout for mobile would be a feature request, but I think the way the button pops below the Snackbar when the text is longer than the available space should be considered a bug.

If you are using it in normal web-app(not mobile-app), this should work:

      <Snackbar
        style={{ pointerEvents: 'none', whiteSpace: 'nowrap' }}
        bodyStyle={{ pointerEvents: 'initial', maxWidth: 'none' }}
      />
Was this page helpful?
0 / 5 - 0 ratings

Related issues

sys13 picture sys13  路  3Comments

activatedgeek picture activatedgeek  路  3Comments

mattmiddlesworth picture mattmiddlesworth  路  3Comments

TimoRuetten picture TimoRuetten  路  3Comments

ghost picture ghost  路  3Comments