Skip to content
This repository has been archived by the owner on Mar 17, 2021. It is now read-only.

Commit

Permalink
Imporoved poppover toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
romanslonov committed Apr 24, 2019
1 parent 5bcf661 commit c913415
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/components/Popover/main.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<template>
<div class="popover" @keydown.esc="close" :class="{'popover--has-max-height': hasMaxHeight}">
<div class="popover__trigger" ref="trigger">
<slot name="toggle"></slot>
</div>

<slot name="toggle"></slot>

<div
ref="content"
role="dialog"
Expand Down Expand Up @@ -75,7 +75,7 @@ export default {
},
computed: {
triggerEl() {
return this.$refs.trigger;
return this.$el.children[0];
},
popperOptions() {
return {
Expand Down Expand Up @@ -131,7 +131,7 @@ export default {
this.focusedElBeforeOpen = document.activeElement;
this.isActive = true;
this.initializePopper();
this.initPopper();
this.$nextTick(() => {
this.$el.focus();
});
Expand Down Expand Up @@ -160,7 +160,7 @@ export default {
this.$el.focus();
}
},
initializePopper() {
initPopper() {
this.$nextTick(() => {
this.popperInstance = new Popper(this.triggerEl, this.$refs.content, this.popperOptions);
});
Expand Down

0 comments on commit c913415

Please sign in to comment.