Commit 3141b800 authored by Heinrich Lee Yu's avatar Heinrich Lee Yu

Fix dropdown position when loading remote data

Also fixes flaky spec
parent e59c3f8e
...@@ -335,6 +335,10 @@ GitLabDropdown = (function() { ...@@ -335,6 +335,10 @@ GitLabDropdown = (function() {
_this.fullData = data; _this.fullData = data;
_this.parseData(_this.fullData); _this.parseData(_this.fullData);
_this.focusTextInput(); _this.focusTextInput();
// Update dropdown position since remote data may have changed dropdown size
_this.dropdown.find('.dropdown-menu-toggle').dropdown('update');
if ( if (
_this.options.filterable && _this.options.filterable &&
_this.filter && _this.filter &&
......
...@@ -570,10 +570,10 @@ ...@@ -570,10 +570,10 @@
} }
.dropdown-menu-close { .dropdown-menu-close {
right: 5px; top: $gl-padding-4;
right: $gl-padding-8;
width: 20px; width: 20px;
height: 20px; height: 20px;
top: -1px;
} }
.dropdown-menu-close-icon { .dropdown-menu-close-icon {
......
---
title: Fix dropdown position when loading remote data
merge_request: 28526
author:
type: fixed
...@@ -352,6 +352,8 @@ describe 'Issue Boards', :js do ...@@ -352,6 +352,8 @@ describe 'Issue Boards', :js do
page.within('.labels') do page.within('.labels') do
click_link 'Edit' click_link 'Edit'
wait_for_requests
click_link 'Create project label' click_link 'Create project label'
fill_in 'new_label_name', with: 'test label' fill_in 'new_label_name', with: 'test label'
first('.suggest-colors-dropdown a').click first('.suggest-colors-dropdown a').click
...@@ -368,6 +370,8 @@ describe 'Issue Boards', :js do ...@@ -368,6 +370,8 @@ describe 'Issue Boards', :js do
page.within('.labels') do page.within('.labels') do
click_link 'Edit' click_link 'Edit'
wait_for_requests
click_link 'Create project label' click_link 'Create project label'
fill_in 'new_label_name', with: 'test label' fill_in 'new_label_name', with: 'test label'
first('.suggest-colors-dropdown a').click first('.suggest-colors-dropdown a').click
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment