Only focus search in dropdown if it has artifacts
What does this MR do and why?
For #372450 (closed)
We added a search box to the artifacts dropdown (!94859 (merged)), and opening the dropdown should focus on the search box inside, but when the dropdown is opened with no artifacts and no search box to focus on, a console error is thrown. This MR fixes that by only focusing on the search box if the dropdown has artifacts.
Screenshots or screen recordings
the console error this gets rid of |
---|
How to set up and validate locally
Replicate the bug
git checkout master
- run a pipeline that generates no artifacts
- navigate to the pipeline list page
- open your browser's devtools
- click the download icon dropdown next to the pipeline
- an error should appear in the devtools console
🐛
Test the fix
git checkout 372450-fix-artifact-dropdown-console-error
- refresh the page
- click the download icon dropdown next to the pipeline
- no error should appear in the devtools console
🎉
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Miranda Fluharty