From 27b8c7b2e4969171562a7ae033a17a419860572f Mon Sep 17 00:00:00 2001 From: Philip Mountifield Date: Mon, 17 Feb 2020 10:10:21 +0000 Subject: [PATCH 1/2] fix(b-modal): inconsistent show transition behaviour --- src/components/modal/modal.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/modal/modal.js b/src/components/modal/modal.js index 2371f9edc9f..8f6c38d1ba9 100644 --- a/src/components/modal/modal.js +++ b/src/components/modal/modal.js @@ -604,9 +604,13 @@ export const BModal = /*#__PURE__*/ Vue.extend({ }, onEnter() { this.isBlock = true - // We add show class 1 frame after + // We add show class 1 frame after, requestAF runs the callback before + // the next repaint so we need two calls to guarantee the next frame has + // been rendered requestAF(() => { - this.isShow = true + requestAF(() => { + this.isShow = true + }) }) }, onAfterEnter() { From 7dcc0a28c2737123bd9765e8c418a6f11b717630 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacob=20M=C3=BCller?= Date: Mon, 17 Feb 2020 11:31:17 +0100 Subject: [PATCH 2/2] Update modal.js --- src/components/modal/modal.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/modal/modal.js b/src/components/modal/modal.js index 8f6c38d1ba9..bc2f9702167 100644 --- a/src/components/modal/modal.js +++ b/src/components/modal/modal.js @@ -604,9 +604,9 @@ export const BModal = /*#__PURE__*/ Vue.extend({ }, onEnter() { this.isBlock = true - // We add show class 1 frame after, requestAF runs the callback before - // the next repaint so we need two calls to guarantee the next frame has - // been rendered + // We add the `show` class 1 frame later + // `requestAF()` runs the callback before the next repaint, so we need + // two calls to guarantee the next frame has been rendered requestAF(() => { requestAF(() => { this.isShow = true