-
Notifications
You must be signed in to change notification settings - Fork 272
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
Can't make the toast message uses the whole screen width #282
Comments
Hi @sdumjahn, try using the Dimensions API |
yeah this one threw me for a loop when upgrading. It's probably worth mentioning in the docs that flexbox doesn't work for automatically setting width/height dimensions. |
@calintamas: Thanks for this advice. I found this workaround a few minutes after I created the thread, but I think that this is a bad solution and I would preferrer to have a solution based on flexbox. When this is not possible, I think it should be good to mention this workaround in the docs. |
I'll have to check though, maybe it could be supported. I think it's the container style which breaks it |
Yes, you probably shouldn't center the content. I want to show it on the right side. |
Fixed in It should be possible to have a full width Toast via: <BaseToast style={{ width: '100%' }} /> Or change its alignment: <BaseToast style={{ alignSelf: 'flex-end' }} /> |
@calintamas Sadly only the child element is 80% and aligned to the right. I cannot click the back button. It would be perfect if I could change the styles of the parent as I mentioned in my previous comment :) Thanks! |
@damian-balas Hi, I'll have to think more deeply about it. Ideally, the container styles are provided by the lib and there would be no need to change them. I want to avoid possible layout issues occuring due to not having the complete mental model of how it works and making wrong assumptions when changing the styles. The main objective is to keep a nice DX in general, while also trying to support as many use cases as I can. |
@damian-balas Fixed in v2.1.1, taps behind the Toast should be possible now :) |
Describe the bug
In previous versions I could set the width of the toast message to 100% and the messages uses the whole screen width.
Since the version 2 this does not work anymore.
Steps to reproduce
Steps to reproduce the behavior:
BaseToast
component.Expected behavior
The message should be use the whole size of the screen without any free space left or right.
Screenshots
Code sample
The sizing only works when using explicit width like
width: 200
.Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: