Commit c9dcc398 authored by Winnie Hellmann's avatar Winnie Hellmann

Focus search box when issue board switcher opens

parent b6245fb4
......@@ -147,6 +147,10 @@ export default {
},
toggleDropdown() {
this.open = !this.open;
if (this.open && !this.loading) {
this.$nextTick(this.focusSearchInput);
}
},
loadBoards(toggleDropdown = true) {
if (toggleDropdown) {
......@@ -162,7 +166,10 @@ export default {
this.boards = json;
})
.then(() => this.$nextTick()) // Wait for boards list in DOM
.then(this.setScrollFade)
.then(() => {
this.setScrollFade();
this.focusSearchInput();
})
.catch(() => {
this.loading = false;
});
......@@ -207,6 +214,10 @@ export default {
this.hasMilestoneListMounted = true;
}
},
focusSearchInput() {
const { searchBox } = this.$refs;
searchBox.$el.querySelector('input').focus();
},
},
};
</script>
......
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