Hi All,
I am using date picker widget inside a popup, but when I am scrolling the screen the calendar is getting scrolled along with the screen.
How i can fix this? I don't want to use screen level css .
Thanks
Shivangi
Hello,
Could you please share a sample OML, or provide some guidance on your current setup and the steps required to reproduce the issue?
Hello @Shivangi Thakur
I am not sure there is a fix "without" using CSS.
If I am not mistaken, datepickers and popups have a long history of not working very well with each other. The most common issue is for the calendar to appear behind the popup.
The reason is that the calendar itself is not being rendered as an element of the popup HTML. And in your case, this is probably why it scrolls with the page.
You can always investigate the CSS being applied to the calendar using the Developer tools in the browser and come up with a solution that can be implemented in a class in your application theme or in the style guide (inherited by the application theme), and apply the class to the widget or a container around it, in the same way you apply classes to other elements, centralizing your CSS instead of having it at the screen level.
But this is definitely a CSS problem.
Cheers!
Hi,
Thank you for suggesting the solution. I tried to fix it through css but it didn't work.
So I have attached the oml for reference.
Please Share the OML if it is Possible
Shared the oml, please check.
Hi @Shivangi Thakur
Use SetFlatpickrConfig and set Static property true. It will work.
Thanks,
Sudip
Thank you Sudip,
I learned something now from you today :)I am now curious about what CSS this configuration applies to the calendar.
A question: What will happen if the popup itself is too long and the user can scroll it?
Hi @Eduardo Jauch
For me as well this is new. I learn this approach somewhere from forum posts.
Suppose the pop up has the scroll bar then after opening the date picker the scroll bar height will increase. That means the date picker won't be a floating.
Hi Sudip,
I implemented this solution, and while it works, it creates a UX issue. The date picker is located at the bottom of a large, scrollable popup. When opened, the calendar cuts off at the bottom of the window, forcing users to scroll down further just to select a date. We need a way to adjust the calendar's positioning or alignment to improve the user experience.
Here is the oml .
Hi @Shivangi Thakur ,.my-popup .flatpickr-calendar { position: fixed;} Use css on your container
Hi Vijay,
Tried this but it didnt work .
Hi Shivangi,
This happens because the Date Picker pop-up is rendered inside the scrollable container, so it scrolls together with the screen.
You can fix this by using the “Show Date Picker On” property of the Date Picker / Input widget and making sure the popup is attached to the screen (or a non‑scrolling container), not to the scrollable popup content. Typical approaches are:
Use a non‑scrolling container for the Date Picker. Place the Date Picker in a container that is not inside the scrollable area of the popup (e.g. a header or fixed area of the popup). The calendar will then stay fixed while the popup content scrolls.
.myDatePicker .flatpickr-calendar
{
position: fixed !important;
z-index: 9999;
}
Then configure the widget to use this class for the calendar container.
Arun
Hi Arun,
I tried but it didn't work. Can you share the oml please.
I have attached above for reference.
hi @Shivangi Thakur so you can close the calender when you scroll using javascript , bcz your calender element is outside the popup-content in the DOM.