Skip to content

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
Screen_Shot_2022-09-02_at_10.47.56_AM

How to set up and validate locally

Replicate the bug

  1. git checkout master
  2. run a pipeline that generates no artifacts
  3. navigate to the pipeline list page
  4. open your browser's devtools
  5. click the download icon dropdown next to the pipeline
  6. an error should appear in the devtools console 🐛

Test the fix

  1. git checkout 372450-fix-artifact-dropdown-console-error
  2. refresh the page
  3. click the download icon dropdown next to the pipeline
  4. 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.

Edited by Miranda Fluharty

Merge request reports

Loading