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

Flex layout issue in IE11 (includes fix suggestion) #572

Closed
jkamleh opened this issue Feb 24, 2021 · 6 comments
Closed

Flex layout issue in IE11 (includes fix suggestion) #572

jkamleh opened this issue Feb 24, 2021 · 6 comments
Assignees
Labels
Merged in next Merged but not live

Comments

@jkamleh
Copy link

jkamleh commented Feb 24, 2021

Do you want to request a feature or report a bug?
Bug

What is the current behavior?
Using flex layout (Bootstrap 4) inside Toastify__toast-body class has issues rendering in IE11, works fine in latest Chrome. Example is with one fixed column width (col-md-3) and second column dynamic (col):
image

Proposed fix:
As other users may encounter this while trying to support IE11, suggest adding width: 100%; style by default in

&-body {
margin: auto 0;
padding: 6px;
}

I'm temporarily fixing this by applying the following in my CSS, please advise if this above recommendation is suitable, if so I can create a PR (or feel free to apply):

.Toastify__toast-body {
    width: 100%;
}

What is the expected behavior?
image

Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?
React 16.8.6, Windows, Internet Explorer 11

jkamleh added a commit to jkamleh/react-toastify that referenced this issue Mar 3, 2021
Set toast body to 100% width, to allow child elements to consume all available space on older browsers (e.g. IE11). Fixes fkhadra#572
@jkamleh jkamleh mentioned this issue Mar 3, 2021
@bmolnar2
Copy link

bmolnar2 commented Mar 19, 2021

Hi all!

That change on the body style, removing flex 1 1, cause as an another problem. Considering a ToastContainer with fixed width:

<ToastContainer
  newestOnTop
  closeButton={false}
  closeOnClick={false}
  transition={Slide}
  style={{ width: '591px', cursor: 'default' }}
/>

, the body's div does not grows with the container's size, but only with the content's grows. This leaves us with the situation of having oddly narrow toast messages:
image

instead of our desired width previously:
image

I gotta admit, I'm not an expert on CSS styles, but could not make the custom Toast content to stretch with it's outer div that is the direct child of the Toastify__toast-body div.

Do you have a workaround for this? Is the Toastify__toast-body div really stops the child div from stretching, if it's content does not make the div to grow?

EDIT:
Note, that we use Chrome, so tested in that browser. But the source of the problem is the same change.

@bmolnar2
Copy link

Never mind my question. I realized that I can just override the class style in a new scss file and include, that will override the body. :)

@jkamleh
Copy link
Author

jkamleh commented Apr 19, 2021

@bmolnar2 Hi Bence, I'm not sure what you mean when you refer to removal of flex 1 1. The proposed changes in PR #573 only add width: 100%; to toast body. Even the workaround I mentioned (e.g. your own code), by specifying .Toastify__toast-body only adds to the existing stylesheets (unless you override existing styles defined in the SCSS)?

@bmolnar2
Copy link

@jkamleh, sorry, I did not link the change. It wasn't #573 , but this: 468d545
Probably I thought this bug was reported as one caused by the latter.

For my case, the solution was to override the style in SCSS. Obviously not with the change you proposed, but whatever is necessary (e.g. adding back flex 1 1).

The point is that you can customize certain class styles of the lib, so unless that was a change concerning every user, it doesn't make sense to revert any piece of change for my case. (Not like anyone was considering it. :D)

@fkhadra
Copy link
Owner

fkhadra commented Apr 22, 2021

@bmolnar2 tbh I don't remember why I've removed flex 1 1, maybe a mistake from my side. I'll dig deeper

@fkhadra
Copy link
Owner

fkhadra commented Apr 22, 2021

Ok, I remember why I did it... I forgot to revert this thing 🤣

@fkhadra fkhadra self-assigned this Apr 22, 2021
@fkhadra fkhadra added the Merged in next Merged but not live label Apr 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Merged in next Merged but not live
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants