diff --git a/src/components/modal/modal.js b/src/components/modal/modal.js index f002a33431d..d1ff2bc0be5 100644 --- a/src/components/modal/modal.js +++ b/src/components/modal/modal.js @@ -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) } }) }