Коммит 5387fcc3 создал по автору Phil Hughes's avatar Phil Hughes
Просмотр файлов

Fixed enter key for GL dropdown in JS

владелец 6985fea2
......@@ -255,8 +255,13 @@
if (_this.dropdown.find('.dropdown-toggle-page').length) {
selector = ".dropdown-page-one " + selector;
}
$(selector, _this.dropdown).first().find('a').addClass('is-focused');
return currentIndex = 0;
if ($(_this.el).is('input')) {
currentIndex = -1;
} else {
$(selector, _this.dropdown).first().find('a').addClass('is-focused');
currentIndex = 0;
}
}
};
})(this)
......@@ -611,7 +616,11 @@
if ($el.length) {
e.preventDefault();
e.stopImmediatePropagation();
return $el.first().trigger('click');
$el.first().trigger('click');
if ($el.first()[0] && $el.first()[0].click) {
$el.first()[0].click();
}
}
};
......
......@@ -66,7 +66,10 @@
},
data: this.getData.bind(this),
selectable: true,
clicked: this.onClick.bind(this)
clicked: this.onClick.bind(this),
id: function (data) {
return _.escape(data.text);
}
});
};
......
......@@ -51,6 +51,16 @@
end
describe 'Right header search field', feature: true do
it 'allows enter key to search', js: true do
visit namespace_project_path(project.namespace, project)
fill_in 'search', with: 'gitlab'
find('#search').native.send_keys(:enter)
page.within '.title' do
expect(page).to have_content 'Search'
end
end
describe 'Search in project page' do
before do
visit namespace_project_path(project.namespace, project)
......
Поддерживает Markdown
0% или .
You are about to add 0 people to the discussion. Proceed with caution.
Сначала завершите редактирование этого сообщения!
Пожалуйста, зарегистрируйтесь или чтобы прокомментировать