From 0e4196c91acd779c7e45aba0c74d57433b76ce4d Mon Sep 17 00:00:00 2001 From: Sivin Varghese <64252451+iamsivin@users.noreply.github.com> Date: Mon, 16 Aug 2021 22:11:20 +0530 Subject: [PATCH] enhancement: Removes the focus of the first item in the dropdown when it is active. (#2833) --- .../shared/components/ui/dropdown/DropdownMenu.vue | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/app/javascript/shared/components/ui/dropdown/DropdownMenu.vue b/app/javascript/shared/components/ui/dropdown/DropdownMenu.vue index 4857a5014..2f72a824c 100644 --- a/app/javascript/shared/components/ui/dropdown/DropdownMenu.vue +++ b/app/javascript/shared/components/ui/dropdown/DropdownMenu.vue @@ -25,9 +25,6 @@ export default { default: 'top', }, }, - mounted() { - this.focusItem(); - }, methods: { dropdownMenuButtons() { return this.$refs.dropdownMenu.querySelectorAll( @@ -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;