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

on scrolling popup for dropdown appears in top sometime and in bottom sometime

on scrolling popup for dropdown appears in top sometime and in bottom sometime i need dropdown to appear in the top even in scrolling instead of appearing in bottom

1 Reply

PO Prince Oliver Syncfusion Team June 18, 2019 11:28 AM UTC

Hi Thowfik,  
 
Thank you for contacting us. 
 
We have checked the reported scenario. By default, the dropdown will open at the bottom. If there is not enough space to open the popup at the bottom then, the popup will open at the top. This is default behavior of popup components. To open the dropdown at top we suggest you use DropDownList open event, in that you can get the popupHeight and set a negative value into popup offsetY property. Please find the code snippet below 
 
[HTML] 
<ejs-dropdownlist #dropdown id='games' #sample [dataSource]='sportsData' [value]='value' [fields]='fields' 
  [placeholder]='waterMark' [popupHeight]='height' (open)="onddlPopupOpen($event, dropdown)"></ejs-dropdownlist> 
 
[ts] 
onddlPopupOpen(event: PopupEventArgs, ddlObj) { 
  event.popup.offsetY = -(parseInt(ddlObj.popupHeight)); 
  event.popup.collision = { X: 'fit', Y: 'fit' }; 
  event.popup.dataBind(); 
  event.popup.refreshPosition(ddlObj.element, false); 
} 
 
Please find the sample at the following location: 
 
Let us know if you need any further assistance on this. 
 
Regards, 
Prince 


Loader.
Live Chat Icon For mobile
Up arrow icon