Patch #42440
closedFix project selector focus by explicitly targeting the first selected item
Description
The current implementation in application.js attempts to focus on all elements matching .drdn-items a.selected when the project jump dropdown is expanded. This can cause unpredictable behavior if multiple elements match this selector, as only one element should receive focus.
This patch modifies the code to explicitly focus only on the first selected element by adding the .first() method before calling .focus(). This ensures consistent behavior when navigating the project selector dropdown.
In the project selection dropdown in the upper right corner, when you open a bookmarked project, the project that gets selected is not the one in the bookmark area but the one in the list below. I believe this degrades the usability when switching between bookmarked projects during work.
Steps to reproduce:
1. Have multiple projects that could be selected in the project jump dropdown
2. Bookmark one
3. Open the project selector dropdown
4. Select the bookmarked project and see the selected position
This is a simple fix that improves the reliability of the project navigation interface.
Files
Updated by Mizuki ISHIKAWA 13 days ago
I was able to reproduce the issue.
Just to be sure, I checked the case when there is no selected element, and confirmed that selected.first().focus(); does not cause any errors in that case.
The patch fix looks good to me.
Updated by Go MAEDA 6 days ago
- Subject changed from Fix project selector focus when multiple elements are selected to Fix project selector focus by explicitly targeting the first selected item
- Status changed from New to Resolved
- Assignee set to Go MAEDA
Committed the fix in r23558. Thank you for your contribution.