• Jacob Schatz's avatar
    Merge branch 'lbennett/gitlab-ce-17465-search-for-project-with-cursor-keys' into 'master' · 9510073d
    Jacob Schatz authored
    17465 Fixed dropdown cursor key navigation
    
    ## What does this MR do?
    This MR fixes the use of cursor/arrow/enter key events with search dropdowns, allowing a user to navigate up and down the list with the arrow keys and then select their item with the enter key.
    It also applies some *minor* scroll user experience fixes, such as resetting the selected dropdown item every time it opens/closes (also stops multiple dropdowns conflicting) and forcing the dropdown scroll to scroll right to the top or bottom depending on whether they have selected the first or last item, respectively.
    
    ## Are there points in the code the reviewer needs to double check?
    I would like someone with GitLab experience to check over whether this would harm any unique implementations of the GitLabDropdown or SearchAutocomplete.
    
    ## Why was this MR needed?
    The current version has incorrectly behaving search dropdowns in the navbar, they either do not navigate using the keyboard or do not use the enter keystroke to select a highlighted item.
    
    ## What are the relevant issue numbers?
    Fixes #17465.
    Closes #20752.
    Closes #21014.
    **Contributes** to #20754.
    
    ## Screenshots (if relevant)
    ![17465.mp4](/uploads/1145abec226036abbaaa4aa46020f52b/17465.mp4)
    
    See merge request !4781
    9510073d
gl_dropdown.js 24.7 KB