Skip to content

Commit

Permalink
[modal] focusFirst timing tweak (#357)
Browse files Browse the repository at this point in the history
* [modal] focusFirst timing fix

* [modal] focusFirst on open timing tweak
  • Loading branch information
tmorehouse authored and pi0 committed May 8, 2017
1 parent 2e067e8 commit 7a86620
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions lib/components/modal.vue
Expand Up @@ -3,6 +3,7 @@
<transition-group enter-class="hidden"
enter-to-class=""
enter-active-class=""
@after-enter="focusFirst"
leave-class="show"
leave-active-class=""
leave-to-class="hidden"
Expand Down Expand Up @@ -184,10 +185,6 @@
// Handle constrained focus
document.addEventListener('focusin', this.enforceFocus, false);
}
this.$nextTick(function () {
// Make sure DOM is updated before focusing
this.focusFirst();
});
},
hide(isOK) {
if (!this.is_visible) {
Expand Down Expand Up @@ -253,7 +250,9 @@
if (!el) {
el = this.$refs.content;
}
el.focus();
if (el && el.focus) {
el.focus();
}
},
returnFocusTo() {
if (this.return_focus) {
Expand Down

0 comments on commit 7a86620

Please sign in to comment.