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

[Snackbar] Action disappears if message is too long #2826

Closed
DavidLGoldberg opened this issue Jan 7, 2016 · 6 comments
Closed

[Snackbar] Action disappears if message is too long #2826

DavidLGoldberg opened this issue Jan 7, 2016 · 6 comments
Labels
bug 🐛 Something doesn't work component: snackbar This is the name of the generic UI component, not the React module!

Comments

@DavidLGoldberg
Copy link

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

@zachguo
Copy link
Contributor

zachguo commented Jan 8, 2016

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.

@mbrookes
Copy link
Member

mbrookes commented Jan 8, 2016

@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 oliviertassinari added the new feature New feature or request label Jan 8, 2016
@mbrookes
Copy link
Member

mbrookes commented Jan 8, 2016

@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.

@oliviertassinari oliviertassinari added the bug 🐛 Something doesn't work label Jan 8, 2016
@oliviertassinari oliviertassinari changed the title Snackbar: Action disappears if message is too long [Snackbar] Action disappears if message is too long Sep 17, 2016
@oliviertassinari oliviertassinari removed the new feature New feature or request label Sep 17, 2016
@oliviertassinari oliviertassinari added the component: snackbar This is the name of the generic UI component, not the React module! label Dec 18, 2016
@Stupidism
Copy link

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' }}
      />

@tigerabrodi
Copy link

@oliviertassinari @samuelsycamore @eps1lon

I know this issue is closed, but am I doing something wrong here:

The action isn't showing at all, and the docs don't really help much here.

        <Snackbar
          open={isSnackbarOpen}
          onClose={handleCloseSnackbar}
          anchorOrigin={{ vertical: 'top', horizontal: 'center' }}
          action={
            <>
              <Button onClick={() => addPendingRowToSelectionModel()}>Continue</Button>
              <IconButton aria-label="close" sx={{ p: 0.5 }} onClick={handleCloseSnackbar}>
                <Close />
              </IconButton>
            </>
          }
        >
          <Alert severity="error" variant="filled" sx={{ width: '100%' }}>
            Total delivery size will be &gt; 500 GB. Are you sure?
          </Alert>
        </Snackbar>

Thank you!

FYI, we're using MUI for our startup, including data grid pro, its awesome! 😁 ❤️

@tigerabrodi
Copy link

Another question, does MUI have a discord to ask questions and does?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: snackbar This is the name of the generic UI component, not the React module!
Projects
None yet
Development

No branches or pull requests

6 participants