When I am trying to run code below toast does not appear in the expected location
<SfToast @ref="SfToast" Content="" />
SfToast.ShowAsync(
new ToastModel()
{
Content = message,
CssClass = "e-toast-success",
Position = new ToastPosition()
{
X = "Center",
Y = "Bottom"
}
}
)
Hi Eimantas,
Greetings from Syncfusion support.
Currently, we are validating your reported issue. We will update you with further details on or before May 24, 2022.
Regards,
Buvana S
Hi Eimantas,
Thank you for your patience.
You will be able to change the toast dynamic position when defining the toast position as a tag like in the below code and sample.
|
<SfToast @ref="SfToast" Content=""> <ToastPosition X="@PositionX" Y="@PositionY"></ToastPosition> </SfToast> @code{ private string PositionX = "Left"; private string PositionY = "Top";
private async Task showOnclick() { PositionX = "Center"; // Change the toast position dynamically PositionY = "Bottom"; await this.SfToast.ShowAsync(new ToastModel() { Content = message, CssClass = "e-toast-success" }); } } |
Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/SfToast-position465490501
Documentation: https://blazor.syncfusion.com/documentation/toast/how-to/show-multiple-toasts-in-various-positions
Regards,
Buvana S
But that is just workaround of something that is clearly not working as expected, otherwise is Position property should not be visible like that.....
We have considered the issue “Toast Position not shown properly when pass inside the ToastModel using ShowAsync public method” as a bug from our end and the fix for the issue will be included with our upcoming weekly patch release on June 14, 2022.
You can now track the current status of the report, review the proposed resolution timeline, and contact us for any further inquiries through this link:
We have included the fix for the issue "Toast Position not shown properly when pass inside the ToastModel using ShowAsync public method" with our package version 20.1.59. So, can you please upgrade your package to the latest to resolve the issue from your end.
Release Note: https://blazor.syncfusion.com/documentation/release-notes/20.1.59?type=all#dialog-1