Toast isn't showing full width on first try and show full width afterwards

The toast is showing in the middle but it's not full width. I'd set the width to 100%. But if you click the button again to have the toast shown then It is showing full width. How come it's not showing full width at the first try and only showing full width afterward. The following is my code.

<SfToast ID="toast_default" @ref="ToastObj" Title="Error" Width="100%" CssClass="e-toast-warning" ShowCloseButton="true" Timeout="0">

<ToastPosition X="@ToastPosition"></ToastPosition>

<ToastTemplates>

<Template>

<div class="m-3">

<h4>@ToastContent</h4>

<SfButton CssClass="btn btn-primary" OnClick="Confirm">Confirm</SfButton>

<SfButton CssClass="btn btn-light" OnClick="Close">Close</SfButton>

</div>

</Template>

</ToastTemplates>

</SfToast>



This is how it showed when I tried first time

Image_4039_1724652037157

This is when I try afterwards. 
Image_3703_1724652060321


2 Replies

KP Kokila Poovendran Syncfusion Team August 26, 2024 11:04 AM UTC

Hi Min Thant Aung Aung


We have Already included the fix for the issue "When the width is set to “100%,” the “e-toast-full-width” class is not added to the toast container element the first time" with our package version “26.2.8”. Therefore, we recommend upgrading to our latest version to resolve the current issue.


Root cause


In the toast component, when we set the width to 100%, the "e-toast-full-width" class is not updated the first time but updates the second time. This occurs because the status change method executes before the "e-toast-full-width" class is added, which is the root cause of this issue.


Release notes: https://blazor.syncfusion.com/documentation/release-notes/26.2.8?type=all#bug-fixes-6


Sample: https://blazorplayground.syncfusion.com/rZhTNFhxKaFyghVH



MT Min Thant Aung Aung August 26, 2024 12:15 PM UTC

Thanks, after updating the pkg. It works.


Loader.
Up arrow icon