Hi Adam,
We have reviewed your issue and recommend the following solution to ensure that new toasts are added on top of existing ones, without replacing the previous content.
In your implementation, modify the toast display logic by using the ShowAsync method with a new ToastModel for each toast. Below is the updated code snippet to achieve this:
protected override async Task OnInitializedAsync() { ToastService.ShowToastTrigger += (ToastOption options) => { InvokeAsync(async () => { this.Options.Title = options.Title; this.Options.Content = options.Content; this.IsToastVisible = true; this.StateHasChanged(); //this.Toast1.ShowAsync(); this.Toast1.ShowAsync(new ToastModel() { Title = options.Title, Content = options.Content }); }); }; base.OnInitialized(); }
|
By using this.Toast1.ShowAsync(new ToastModel() { Title = options.Title, Content = options.Content }) instead of the default this.Toast1.ShowAsync(), each toast will display as a unique instance without overwriting the previous ones.
Regards,
Kokila Poovendran.
Attachment:
toastserviceissue_bbe2f12e_(2)_17972fcc.zip