Skip to content
This repository has been archived by the owner on Oct 4, 2022. It is now read-only.

[material-ui] When a toast displays, all text on my page gets slightly larger #65

Open
stuckinaboot opened this issue Jul 16, 2020 · 2 comments

Comments

@stuckinaboot
Copy link

stuckinaboot commented Jul 16, 2020

First I'd like to say I'm a huge fan of this module. However, an issue I'm having is when a toast displays using cogo-toast that all of the text on my page gets slightly larger. When the toast dismisses, the text goes back to its original size. Any reason why this occurs? Any way to get around this?

To reproduce, have some existing text on your page and then display a toast. Worth noting, I am using materialui so maybe there's some issue with that + cogo-toast interacting?

@stuckinaboot stuckinaboot changed the title When a toast displays, all test on my page gets slightly larger When a toast displays, all text on my page gets slightly larger Aug 3, 2020
@stuckinaboot
Copy link
Author

I've narrowed this down to the culprit being the Typography component when using material-ui.

@stuckinaboot stuckinaboot changed the title When a toast displays, all text on my page gets slightly larger [material-ui ]When a toast displays, all text on my page gets slightly larger Aug 28, 2020
@stuckinaboot stuckinaboot changed the title [material-ui ]When a toast displays, all text on my page gets slightly larger [material-ui] When a toast displays, all text on my page gets slightly larger Aug 28, 2020
@stuckinaboot
Copy link
Author

stuckinaboot commented Aug 28, 2020

This is the code I used for the body of the alert to allow for customization with a button but to get around the constraint of cogo-toast not placing nicely with Typography in material-ui:

<Grid container style={{ fontSize: 16 }}>
      <Grid item xs={12}>
        Some body text
        {button != null ? (
          <Box
            style={{
              display: "flex",
              flexDirection: "column",
              alignItems: "flex-end",
              width: "100%",
            }}
          >
            <Box
              style={{
                backgroundColor: "grey",
                padding: 10,
                fontWeight: "bold",
              }}
              onClick={()=>{
                 // do something
              }}
            >
              Button title text
            </Box>
          </Box>
        ) : null}
      </Grid>
    </Grid>,

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

No branches or pull requests

1 participant