Skip to content

Commit

Permalink
fix($theme-default): close dropdown-links when focusout on the last i…
Browse files Browse the repository at this point in the history
…tem (close #1948) (#1952)
  • Loading branch information
Sun Haoran authored and ulivz committed Oct 21, 2019
1 parent 55c03f6 commit cd72acc
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/@vuepress/theme-default/components/DropdownLink.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
class="dropdown-title"
type="button"
:aria-label="dropdownAriaLabel"
@click="toggle"
@click="setOpen(!open)"
>
<span class="title">{{ item.text }}</span>
<span
Expand Down Expand Up @@ -41,15 +41,15 @@
@focusout="
isLastItemOfArray(childSubItem, subItem.items) &&
isLastItemOfArray(subItem, item.items) &&
toggle()
setOpen(false)
"
:item="childSubItem"/>
</li>
</ul>

<NavLink
v-else
@focusout="isLastItemOfArray(subItem, item.items) && toggle()"
@focusout="isLastItemOfArray(subItem, item.items) && setOpen(false)"
:item="subItem"
/>
</li>
Expand Down Expand Up @@ -86,8 +86,8 @@ export default {
},
methods: {
toggle () {
this.open = !this.open
setOpen (value) {
this.open = value
},
isLastItemOfArray (item, array) {
Expand Down

0 comments on commit cd72acc

Please sign in to comment.