I would want to make Pop-up follow the component who open it. I did some research and found that e-popup have a absolute position and calculate top and left attribut to make them have right side align with DateRangePicker or DropDownList.
In my component with a DateRangePicker:
<SfDateRangePicker TValue="DateTime?" StartDate="@_StartDate" EndDate="@_EndDate" CssClass="mb-0">
<DateRangePickerEvents TValue="DateTime?" ValueChange="DateRangeChanged" @on></DateRangePickerEvents>
<DateRangePickerPresets>
<DateRangePickerPreset Label="Cette Semaine" Start="@weekStart" End="@weekEnd"></DateRangePickerPreset>
<DateRangePickerPreset Label="Ce mois-ci " Start="@thisMonthStart" End="@thisMonthEnd"></DateRangePickerPreset>
<DateRangePickerPreset Label="Le mois dernier" Start="@lastMonthStart" End="@lastMonthEnd"></DateRangePickerPreset>
<DateRangePickerPreset Label="Cette année " Start="@thisYearStart" End="@thisYearEnd"></DateRangePickerPreset>
<DateRangePickerPreset Label="L'année dernière" Start="@lastYearStart" End="@lastYearEnd"></DateRangePickerPreset>
<DateRangePickerPreset Label="Tout" Start="@allStart" End="@allEnd"></DateRangePickerPreset>
</DateRangePickerPresets>
</SfDateRangePicker>
The DateRangePicker and the popup open before width change:
And the DataRangePicker when width change after opening it:
Do you have any idea on how i could make the popup follow the position of the DateRangePicker when the windows size change ?
|
|
|
|
Hello,
I saw your demo but your demo has the same problem for me ( if you reduce windows size) the popup doesn't follow the daterangepicker position. You create the popup in absolute position, the problem is if I want to resize window, the popup can be outside. It's not a problem like a bug but more a problem on capacity and responsive side.
Do you have a method to make it follow the daterangepicker position or did you make it possible to change position of popup to relative/sticky... ?
|
window.addEventListener('resize', function (event) {
document.getElementById('daterange').blazor__instance.refreshPopup();
}); |
|
<SfDateRangePicker TValue="DateTime?" ID="daterange" Placeholder="Choose a Range" ShowClearButton="true">
<DateRangePickerPresets>
<DateRangePickerPreset Label="This Week" Start="@WeekStart" End="@WeekEnd"></DateRangePickerPreset>
<DateRangePickerPreset Label="This Month" Start="@MonthStart" End="@MonthEnd"></DateRangePickerPreset>
<DateRangePickerPreset Label="Last Month" Start="@LastMonthStart" End="@LastMonthEnd"></DateRangePickerPreset>
<DateRangePickerPreset Label="Last Year" Start="@LastYearStart" End="@LastYearEnd"></DateRangePickerPreset>
</DateRangePickerPresets>
</SfDateRangePicker> |