Keyboard navigation for the label dropdown has an off-by-one error
What does this MR do?
In the dropdown, when the user uses the up and down keys and then the enter key to select an option the wrong option was being selected in the labels.
The index was being calculated by counting all the li. In the assignee dropdown since there is a li.divider it was being counted as well. The code was preventing this by subtracting one which caused the error in the label dropdown. This solution fixes it by selecting only the li with options and then finding the index for the selected one.
Are there points in the code the reviewer needs to double check?
I am not sure there are any other possible li that do not have options. That would be a thing to check.
Why was this MR needed?
It was a bug.
What are the relevant issue numbers?
Closes #20752 (closed)
Screenshots (if relevant)
Does this MR meet the acceptance criteria?
-
CHANGELOG entry added -
Documentation created/updated -
API support added - Tests
-
Added for this feature/bug -
All builds are passing
-
-
Conform by the style guides -
Branch has no merge conflicts with master
(if you do - rebase it please) -
Squashed related commits together
Merge request reports
Activity
Reassigned to @jschatz1
Added frontend label
Milestone changed to %8.10
Reassigned to @lbennett
mentioned in merge request !4781 (merged)
@Lacerda1 Hold off on that, I've had a small refactor of this class in the pipeline for a few months now, it has tests too. Check it out !4781 (merged). Sorry for the confusion here, this has been a tough class to crack for the whole team.
@Lacerda1 Thanks for submitting this, it looks like it has been already addressed on !4781 (merged). I'm closing this.