Skip to content

Commit

Permalink
fix(modal): fix scroll to top issue when modal has no-fade set (#4004)
Browse files Browse the repository at this point in the history
  • Loading branch information
tmorehouse committed Sep 3, 2019
1 parent 3aa78fd commit 332b79f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/components/modal/modal.js
Expand Up @@ -775,11 +775,14 @@ export const BModal = /*#__PURE__*/ Vue.extend({
: autoFocus === 'close' && close
? close.$el || close
: content
// Make sure top of modal is showing (if longer than the viewport)
// Focus the element
attemptFocus(el)
if (el === content) {
modal.scrollTop = 0
// Make sure top of modal is showing (if longer than the viewport)
this.$nextTick(() => {
modal.scrollTop = 0
})
}
attemptFocus(el)
}
})
}
Expand Down

0 comments on commit 332b79f

Please sign in to comment.