In Safari, the footer buttons of the calendar popup (Today, Clear, Close) do nothing. The popup closes, but the button action never runs. Clicking a day in the grid works.
Steps to reproduce:
6.1
The field is set to today's date (Today) or emptied (Clear), as in Chrome or Firefox.
The popup closes and the field stays unchanged.
Joomla 6.1.4, PHP 8.5, Safari on macOS. The calendar script is unchanged in 6.2.0, so the bug is still there.
Cause: #48286 (Calendar keyboard navigation) added _handleFocusOut in calendar.es5.js. It hides the popup on focusout unless relatedTarget is inside the calendar. Safari does not move focus to a <button> on click, so relatedTarget is null. The popup hides on mousedown, before click fires, and the button handler never runs. Day cells work because they react on mousedown.
Because #48286 was merged into 5.4-dev, 5.4.x is probably affected too (not tested).
Workaround we use as a small site-wide script:
document.addEventListener('mousedown', function (ev) {
if (ev.target.closest && ev.target.closest('.js-calendar button[data-action]')) {
ev.preventDefault(); // keep focus in the input, so focusout does not fire
}
}, true);A fix in core could do the same in the calendar itself (preventDefault() on mousedown for the footer buttons). Another option is to ignore focusout with relatedTarget === null while the pointer is down inside the popup.
| Labels |
Added:
No Code Attached Yet
|
||
confirmed the bug
have not tested the proposed fix
| Labels |
Added:
bug
|
||
confirmed