How to position the dropdownMenu relative to SFDropDownButton that opened it

I have a number of different SfDropDownButtons on a Blazor page that opens a dropdownmenu with the same content.  When I open the DropDownMenu it is opening a dialog box that scrolls on the page that is not "anchored" to button that opened it.  How can position the DropDownMenu relative to EACH individual SFDropDownButton on the page?

Sample code is 

There a rows of these same divs for different products on the page and 

<div id="abc" class="custom-actions">
                    <SfDropDownButton  CssClass="custom-button">
                        <DropDownButtonEvents ItemSelected="ButtonItemSelected" OnItemRender="ButtonItemRendered" OnOpen="ButtonOpen">         </DropDownButtonEvents>
                        <DropDownMenuItems >
                            <DropDownMenuItem Text='View' Url="@item.NavigatePage"></DropDownMenuItem>
                            <DropDownMenuItem Text='Buy' Url="@item.Id")"></DropDownMenuItem>
                    </ActionButtonItems>
                        </DropDownMenuItems>
                    </SfDropDownButton>
                </div>

3 Replies 1 reply marked as answer

MK Mohan Kumar Ramasamy Syncfusion Team August 14, 2020 01:26 PM UTC

Hi Anna, 
 
We have checked your reported query, we are not able to reproduce it in our end. We suspect that the problem occurs due to you refer old version style file. 
 
<link rel='nofollow' href="https://cdn.syncfusion.com/ej2/material.css" rel="stylesheet" /> 
 
Or 
 
<link rel='nofollow' href="_content/Syncfusion.Blazor/styles/bootstrap4.css" rel="stylesheet" /> 
 
 
 
For your reference, we have prepared a sample based on this, please refer below link. 
 
 
If you still face this issue due to the following cases.     
     
·         Due to the old Browser/NuGet cache.  
·         Outdated custom scripts referred in the application.  
     
Also, could you please ensure the problem after clearing the browser/NuGet cache or run the application using incognito window of the browser.     
 
kindly share the below details. 
 
  • If possible, try to reproduce the reported issue in provided sample or share the issue reproducible sample
Please provide the above requested information, based on that we will check and provide you a better solution quickly. 
 
Please let us know, if you need any further assistance, 
 
Regards, 
Mohankumar R 
 



GS Grant Shoemaker August 18, 2020 02:59 PM UTC

Hi Mohan. 

Your example works with the default layout for a Blazor page. However, on your sample site, as well as the site we are developing with, the scrolling content area is not based on the overall position of the page itself, just the scroll area. To show this, open your own example page at https://blazor.syncfusion.com/demos/buttons/dropdown-menu?theme=material and resize the browser so that the page scrolls vertically some. Click a dropdown menu and then use the mouse scroll wheel to scroll and you will see that the dropdown menu does not scroll along with the dropdown button. This is the same behavior we have in our application.

I have attached a screenshot of your demo page exhibiting the issue.


Attachment: Capture1_b914703e.zip


MK Mohan Kumar Ramasamy Syncfusion Team August 19, 2020 05:08 PM UTC

Hi Anna, 
 
Sorry for inconvenience caused. We have checked your reported query, we can reproduce the reported issue in our end. We have logged an issue report for this, and we will include this fix in any of our upcoming patch release. You can track the status in the below feedback link.  
 
 
We would like to let you know that, you can achieve the workaround solution your requirement. We have bound scroll event for parent element then called Toggle method. Please find the below sample 
 
 
Please let us know if you need further assistance on this. 
 
Regards, 
Mohankumar R 


Marked as answer
Loader.
Up arrow icon