When multiple toasts are shown, the last one always shows the wrong toast content.

I have an edit form within a dialog. The edit form contains multiple drop down lists. On submission, a validation function checks to see whether the drop down lists have been selected. If not, a toast is generated dynamically to inform the user that they must select from the appropriate dropdown list. 

I have created an example project that shows the problem that I have.

If none of the four dropdowns are selected, on submission four toasts appear - the content of the first three is correct but the fourth one is a repeat of the third toast.
If one of the four dropdowns is selected, on submission three toasts appear - the content of the first two is correct but the third one is a repeat of the second toast.

Only if I select the first three dropdowns, so that only one toast appears after submission, do I get the correct content for the non selection of the fourth dropdown!

Attachment: ToastTest_33462019.zip

3 Replies 1 reply marked as answer

RK Revanth Krishnan Syncfusion Team January 19, 2021 02:21 PM UTC

Hi Andrew, 


Greetings from Syncfusion support. 


We have validated your query “The edit form contains multiple drop down lists. On submission, a validation function checks to see whether the drop down lists have been selected. If not, a toast is generated dynamically to inform the user that they must select from the appropriate dropdown list.” The following are the issue occurs 
  • If none of the four dropdowns are selected, on submission four toasts appear - the content of the first three is correct but the fourth one is a repeat of the third toast.
  • If one of the four dropdowns is selected, on submission three toasts appear - the content of the first two is correct but the third one is a repeat of the second toast.
  • Only if I select the first three dropdowns, so that only one toast appears after submission, do I get the correct content for the non selection of the fourth dropdown!

We are able to reproduce all the above reported issue, and these issues can be resolved by passing the `Content` and the `Title` property in the `Show` method as `ToastModel`. We have modified your shared sample for your reference, 

Code Snippet: 

private async Task ShowToast(string title, string content, string colour) 
   
        toastColour = colour; 
        await Task.Delay(1000); 
        await MyToastObj.Show(new ToastModel() { Title = title, Content = content }); 
   
  

Please check the above code snippet and the sample and let us know if it resolves your issue. 

Regards, 
Revanth 


Marked as answer

AN Andrew January 19, 2021 02:29 PM UTC

Thank you, that has solved my problem.




RK Revanth Krishnan Syncfusion Team January 20, 2021 08:13 AM UTC

Hi Andrew, 
 
Thanks for the update, 
 
Please let us know if you need any further assistance. 
 
Regards, 
Revanth 


Loader.
Up arrow icon