Thank you for providing the detailed explanation and suggestions in #note-2. I appreciate the effort in analyzing the issue and proposing potential solutions.
In my opinion, option (A) seems to be the best approach. Here's why:
As explained in #note-2, the event handler $(document).on('click', '.drdn-trigger', function(e) { ... })
is triggered in two cases:
- When the menu button (...) on pages like the project issues or time tracking pages is clicked.
- When the project jump dropdown is clicked.
The following code in the event handler is necessary only for the project jump dropdown (case 2):
selected = $('.drdn-items a.selected'); // Store selected project
selected.focus(); // Calling focus to scroll to selected project
This code causes the issue because selected = $('.drdn-items a.selected')
targets the <a class="selected" href="/projects/ecookbook?jump=issues" title="eCookbook">
element in the project jump dropdown and applies focus()
. As a result, jQuery UI's tooltip is triggered, displaying the tooltip unnecessarily.
In contrast, this code is not needed when clicking the menu button (...) on pages like the project issues or time tracking pages. It should only execute when the project jump dropdown is clicked.
I investigated where .drdn-trigger
is used and found that it is only applied to the project jump dropdown and the problematic menu buttons on project pages. It seems likely that restricting the code execution to the project jump dropdown would address the issue.
This issue does not occur in Redmine 5.1. While the implementation for handling menu button clicks has not changed, the versions of jQuery and jQuery UI have been updated. The changes in jQuery and jQuery UI might be causing this issue.
For example, when running the following code in DevTools, the tooltip appears only in Redmine 6.0 (jQuery 3.7.1):
$('#project-jump [title="eCookbook"]').focus();
It seems that the behavior of focus()
might have changed in the newer versions of jQuery or jQuery UI, which could be causing the tooltip to appear.
Regardless, the problematic code is necessary only when the project jump dropdown is clicked. For this reason, in my opinion, option (A) seems to be the most reasonable solution.