Merge branch 'ide-row-dropdown-scroll' into 'master'

Fixed Web IDE row dropdowns scrolling list incorrectly

Closes #49892

See merge request gitlab-org/gitlab-ce!20984
This commit is contained in:
Filipa Lacerda 2018-08-02 15:08:57 +00:00
commit f5b9e28790
2 changed files with 6 additions and 2 deletions

View file

@ -35,7 +35,9 @@ export default {
watch: {
dropdownOpen() {
this.$nextTick(() => {
this.$refs.dropdownMenu.scrollIntoView();
this.$refs.dropdownMenu.scrollIntoView({
block: 'nearest',
});
});
},
mouseOver() {

View file

@ -62,7 +62,9 @@ describe('new dropdown component', () => {
vm.dropdownOpen = true;
setTimeout(() => {
expect(vm.$refs.dropdownMenu.scrollIntoView).toHaveBeenCalled();
expect(vm.$refs.dropdownMenu.scrollIntoView).toHaveBeenCalledWith({
block: 'nearest',
});
done();
});