Hi.
I have noticed the MessageBox will try to size itself to fit the view area where it is shown, but I guess it takes into consideration the whole page. As in the picture attached, we can see the MessageBox shrinked a bit breaking the message text into 2 lines, which is cool, but wasn’t enough since it is shown in a Desktop control and its sides get cropped. Is there a way to workaround this and have it resized to fit the Desktop control behind it?
Thanks in advance.
Ivan
No, the maxWidth and maxHeight are absolute properties. I checked the js code and the wisej.web.MessageBox class (https://github.com/iceteagroup/wisej-js/blob/master/wisej.web.MessageBox.js) limits itself to the window.innerWidth which unfortunately means that it may exceed the Desktop child control. See the _onAppear(e) method.
You can override it with a js patch, see attached zip. Gives you 2 options: 1- maximize the messagebox (which could be a good idea on mobiles), 2-limit the size to the parent.
You set the maxHeight and maxWidth properties for the “messagebox” appearance in the theme or mixin or programmatically changing the theme.
The maxHeight/Width can be applied either for the whole message box or to the content components and the container will adapt.
Thank you Luca for the help, this gives me a starting point.
But I guess I should deal with the size right before I show the message, since the Desktop control could be any size at this moment and then I should take the Desktop width into consideration to be able to calculate the MessageBox width and make sure it would be a bit narrower than its Desktop parent. Can this be accomplished just having a different mixin?
Hi Luca.
I think I found the issue with the patch not being called in my Solution. It looks like if the Assembly Name has spaces in it, it just won’t load the patch, which is my case. I have changed your sample’s Assembly Name from “Wisej.MessageBoxPatch” to “Wisej MessageBoxPatch” and it results in the same issue. I attached it here.
Now, I don’t know if this is an issue or a feature. Is it a bad practicing with Wisej to have spaces in the DLL names?
Please login first to submit.