Skip to content

[modal] focusFirst timing tweak #357

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 8, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions lib/components/modal.vue
Original file line number Diff line number Diff line change
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