Merge pull request #4696 from expsa/eltayar

DEFINITIVE FIX: Preserve default datepicker behavior in ListRenderer
This commit is contained in:
Mohamed Eltayar 2025-09-17 12:14:30 +03:00 committed by GitHub
commit 98c767a7f3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 17 additions and 8 deletions

View File

@ -151,15 +151,24 @@ odoo.define('web_hijri_datepicker.ListRenderer', function (require) {
},
_onWindowClicked: function (event) {
var $target = $(event.target);
if ($target.hasClass('calendars-highlight') ||
$target.closest('.calendars-popup').length ||
$target.closest('.calendars').length ||
$target.hasClass('o_hijri') ||
$target.closest('.o_hijri').length) {
return;
}
this._super.apply(this, arguments);
var $target = $(event.target);
var isHijriElement = $target.hasClass('calendars-highlight') ||
$target.closest('.calendars-popup').length ||
$target.closest('.calendars').length ||
$target.hasClass('o_hijri') ||
$target.closest('.o_hijri').length;
if (!isHijriElement) {
$('.o_hijri').each(function() {
if ($(this).data && $(this).calendarsPicker) {
try {
$(this).calendarsPicker('hide');
} catch (e) {}
}
});
}
}
});
});