Commit 2df84af0 authored by Filipa Lacerda's avatar Filipa Lacerda

Merge branch 'issue-boards-milestone-dropdown-stop-scroll' into 'master'

Fixed multiple boards new form scrolling

Closes #1897

See merge request !1414
parents b60d81fb c7a0ff19
......@@ -59,9 +59,20 @@ const extraMilestones = require('../mixins/extra_milestones');
},
},
methods: {
loadMilestones() {
loadMilestones(e) {
this.milestoneDropdownOpen = !this.milestoneDropdownOpen;
BoardService.loadMilestones.call(this);
if (this.milestoneDropdownOpen) {
this.$nextTick(() => {
const milestoneDropdown = this.$refs.milestoneDropdown;
const rect = e.target.getBoundingClientRect();
milestoneDropdown.style.left = `${rect.left}px`;
milestoneDropdown.style.top = `${rect.bottom}px`;
milestoneDropdown.style.width = `${rect.width}px`;
});
}
},
submit() {
gl.boardService.createBoard(this.board)
......
......@@ -574,8 +574,7 @@
margin-top: 10px;
.dropdown-menu {
top: 60px;
min-width: 100%;
position: fixed;
}
}
......
......@@ -14,10 +14,11 @@
%label.label-light{ for: "board-milestone" }
Board milestone
%button.dropdown-menu-toggle.wide{ type: "button",
"@click.stop.prevent" => "loadMilestones" }
"@click.stop.prevent" => "loadMilestones($event)" }
{{ milestoneToggleText }}
= icon("chevron-down")
.dropdown-menu.dropdown-menu-selectable{ "v-if" => "milestoneDropdownOpen" }
.dropdown-menu.dropdown-menu-selectable{ "v-if" => "milestoneDropdownOpen",
ref: "milestoneDropdown" }
.dropdown-content
%ul
%li{ "v-for" => "milestone in extraMilestones" }
......
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