Add latest changes from gitlab-org/gitlab@master
This commit is contained in:
		
							parent
							
								
									5b650db2d6
								
							
						
					
					
						commit
						6182b82892
					
				| 
						 | 
				
			
			@ -90,6 +90,9 @@ export default {
 | 
			
		|||
    items() {
 | 
			
		||||
      this.selectedIndex = 0;
 | 
			
		||||
    },
 | 
			
		||||
    selectedIndex() {
 | 
			
		||||
      this.scrollIntoView();
 | 
			
		||||
    },
 | 
			
		||||
  },
 | 
			
		||||
 | 
			
		||||
  methods: {
 | 
			
		||||
| 
						 | 
				
			
			@ -182,6 +185,10 @@ export default {
 | 
			
		|||
      this.selectItem(this.selectedIndex);
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    scrollIntoView() {
 | 
			
		||||
      this.$refs.dropdownItems[this.selectedIndex].$el.scrollIntoView({ block: 'nearest' });
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    selectItem(index) {
 | 
			
		||||
      const item = this.items[index];
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -209,6 +216,7 @@ export default {
 | 
			
		|||
    <div class="gl-new-dropdown-inner gl-overflow-y-auto">
 | 
			
		||||
      <gl-dropdown-item
 | 
			
		||||
        v-for="(item, index) in items"
 | 
			
		||||
        ref="dropdownItems"
 | 
			
		||||
        :key="index"
 | 
			
		||||
        :class="{ 'gl-bg-gray-50': index === selectedIndex }"
 | 
			
		||||
        @click="selectItem(index)"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -30736,6 +30736,12 @@ msgstr ""
 | 
			
		|||
msgid "PreScanVerification|Test your configuration and identify potential errors before running a full scan."
 | 
			
		||||
msgstr ""
 | 
			
		||||
 | 
			
		||||
msgid "PreScanVerification|The last pre-scan verification job is no longer valid because this scan’s configuration has changed."
 | 
			
		||||
msgstr ""
 | 
			
		||||
 | 
			
		||||
msgid "PreScanVerification|The pre-scan verification status was reset for this scan"
 | 
			
		||||
msgstr ""
 | 
			
		||||
 | 
			
		||||
msgid "PreScanVerification|Verification checks"
 | 
			
		||||
msgstr ""
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -36626,6 +36632,9 @@ msgstr ""
 | 
			
		|||
msgid "SecurityReports|All activity"
 | 
			
		||||
msgstr ""
 | 
			
		||||
 | 
			
		||||
msgid "SecurityReports|All severities"
 | 
			
		||||
msgstr ""
 | 
			
		||||
 | 
			
		||||
msgid "SecurityReports|Although it's rare to have no vulnerabilities, it can happen. Check your settings to make sure you've set up your dashboard correctly."
 | 
			
		||||
msgstr ""
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -313,5 +313,21 @@ RSpec.shared_examples 'edits content using the content editor' do
 | 
			
		|||
 | 
			
		||||
      expect(page).not_to have_css(suggestions_dropdown)
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    it 'scrolls selected item into view when navigating with keyboard' do
 | 
			
		||||
      type_in_content_editor ':'
 | 
			
		||||
 | 
			
		||||
      expect(find(suggestions_dropdown)).to have_text('hundred points symbol')
 | 
			
		||||
 | 
			
		||||
      expect(dropdown_scroll_top).to be 0
 | 
			
		||||
 | 
			
		||||
      send_keys :arrow_up
 | 
			
		||||
 | 
			
		||||
      expect(dropdown_scroll_top).to be > 100
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    def dropdown_scroll_top
 | 
			
		||||
      evaluate_script("document.querySelector('#{suggestions_dropdown} .gl-new-dropdown-inner').scrollTop")
 | 
			
		||||
    end
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue