Skip to content

Commit

Permalink
enhancement: Removes the focus of the first item in the dropdown when…
Browse files Browse the repository at this point in the history
… it is active. (chatwoot#2833)
  • Loading branch information
iamsivin authored Aug 16, 2021
1 parent 70d41ff commit 0e4196c
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions app/javascript/shared/components/ui/dropdown/DropdownMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ export default {
default: 'top',
},
},
mounted() {
this.focusItem();
},
methods: {
dropdownMenuButtons() {
return this.$refs.dropdownMenu.querySelectorAll(
Expand All @@ -42,13 +39,6 @@ export default {
const activeIndex = [...menuButtons].indexOf(focusedButton);
return activeIndex;
},
focusItem() {
const firstButton = this.$refs.dropdownMenu.querySelector(
'ul.dropdown li.dropdown-menu__item .button'
);
if (firstButton) firstButton.focus();
},
handleKeyEvents(e) {
const menuButtons = this.dropdownMenuButtons();
const lastElementIndex = menuButtons.length - 1;
Expand Down

0 comments on commit 0e4196c

Please sign in to comment.