We have encountered an issue with the Date Picker component in the last 2 versions of Outsystems UI. In earlier versions, when a Date Picker was positioned near the bottom of the screen, the calendar would automatically flip to display above the input. It is now being rendered off-screen making the component unusable. We would like to be able to apply the other bug fixes, but the Date Picker issue is blocking us from making the update. Is there a workaround in the meantime to fix this issue?
Hi @Rebecca Hall ,
I saw you already had some JS in the OnReady, but it wasn’t working, so I updated the implementation. Since Flatpickr officially exposes the position option, this approach is much more reliable than trying to fix it with CSS alone.
You’ll need to add an Extended Class to the Date Picker container (in my example I used js-fix-datepicker). In the OnReady event you can use:
Hi @Rebecca Hall,
You can try adding a handler from the DatePicker Initialized event
and then calling the client action SetFlatpickrConfigs with position = "auto"
Bets Regards,GM
Hi @Rebecca Hall
This JavaScript can serve as an alternative solution. You may use it if it aligns with your needs. I’ve shared it for your reference.
setTimeout(function () {
document.querySelectorAll(".flatpickr-input").forEach(input => {
if (input._flatpickr) {
input._flatpickr.destroy();
flatpickr(input, {
position: "auto"
});
}
}, 200);
Regards,
Vijay M.