Revert "Add <button> and focus styles for keyboard users" (#11089)

This commit is contained in:
Matteo Pagliazzi
2019-03-27 20:56:00 +01:00
committed by GitHub
parent fc08b753cd
commit 1a66a680dc
6 changed files with 11 additions and 60 deletions

View File

@@ -3,7 +3,7 @@ A simplified dropdown component that doesn't rely on buttons as toggles like bo
-->
<template lang="pug">
.habitica-menu-dropdown.dropdown(@click="toggleDropdown()", @keypress.enter.space.stop.prevent="toggleDropdown()", role="button", tabindex="0", :class="{open: isOpen}", :aria-pressed="isPressed")
.habitica-menu-dropdown.dropdown(@click="toggleDropdown()", :class="{open: isOpen}")
.habitica-menu-dropdown-toggle
slot(name="dropdown-toggle")
.dropdown-menu(:class="{'dropdown-menu-right': right}")
@@ -12,27 +12,12 @@ A simplified dropdown component that doesn't rely on buttons as toggles like bo
<style lang="scss">
@import '~client/assets/scss/colors.scss';
.habitica-menu-dropdown {
&:hover,
&:focus { // NB focus styles match the hover styles for .svg-icon
outline: none;
}
}
.habitica-menu-dropdown.open {
.habitica-menu-dropdown-toggle .svg-icon {
color: $white !important;
}
}
// Firefox outline fix for dropdown menu
@supports (-moz-appearance:meterbar) and (all:initial) {
.habitica-menu-dropdown.open {
&:focus {
outline: none;
}
}
}
</style>
<style lang='scss' scoped>
@import '~client/assets/scss/colors.scss';
@@ -81,9 +66,6 @@ export default {
if (this.openStatus !== undefined) return this.openStatus === 1 ? true : false;
return this.isDropdownOpen;
},
isPressed () {
return this.isOpen ? 'true' : 'false';
},
},
mounted () {
document.documentElement.addEventListener('click', this._clickOutListener);