We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Multiselect doesn't initialise with remote data if parent div is hidden

By default it looks like syncfusion doesn't fetch data from remote sources if parent div is hidden or not visible.

This is not very good for my UX as I use accordians and tabs a lot, and edit forms just show "2 selected" etc, in the dropdown.

Is there a way to change this default?

This is example

https://stackblitz.com/edit/urjdry?file=index.html

1 Reply 1 reply marked as answer

SN Sevvandhi Nagulan Syncfusion Team February 18, 2021 12:53 PM UTC

Hello Andrew,  


 
Greetings from Syncfusion support.  

  
  
1. In multiselect component, selected value is updated in the Multiselect view wrapper based on the width calculation.    
2. When parent component like dialog ,tab is made display: none and so components inside dialog or tab (Multiselect) are in hidden state.   
3. When parent element is in display: none, then the offset width of their child is always zero.   
4. Since, in Multiselect, we set the width for the view wrapper based on the component wrapper offset width and because of offset width is zero, view wrapper width is updated as zero.   
5. So, we suggest calling the refresh method in the Dialog or Tab component’s open event to get rid of the reported issue. Refer to the code below.  
 


 
  open: function(args) { 
    args.preventFocus = true; 
    document.getElementById("dialogBtn").style.display = "none"; 
    listObj.refresh(); 
  }, 


 
Please find the sample below,  




 
Regards,  
Sevvandhi N  


Marked as answer
Loader.
Up arrow icon