8000 Update img-lazy.js · bootstrap-vue/bootstrap-vue@cf48a4b · GitHub
[go: up one dir, main page]

Skip to content

Commit cf48a4b

Browse files
committed
Update img-lazy.js
1 parent ad9c7e0 commit cf48a4b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/components/image/img-lazy.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { HAS_INTERACTION_OBSERVER_SUPPORT } from '../../constants/env'
44
import { MODEL_EVENT_NAME_PREFIX } from '../../constants/events'
55
import { PROP_TYPE_BOOLEAN, PROP_TYPE_NUMBER_STRING, PROP_TYPE_STRING } from '../../constants/props'
66
import { concat } from '../../utils/array'
7+
import { requestAF } from '../../utils/dom'
78
import { identity } from '../../utils/identity'
89
import { toInteger } from '../../utils/number'
910
import { omit } from '../../utils/object'
@@ -113,7 +114,11 @@ export const BImgLazy = /*#__PURE__*/ Vue.extend({
113114
// If IntersectionObserver is not supported, the callback
114115
// will be called with `null` rather than `true` or `false`
115116
if ((visible || visible === null) && !this.isShown) {
116-
this.isShown = true
117+
// In a `requestAF()` to render the `blank` placeholder properly
118+
// for fast loading images in some browsers (i.e. Firefox)
119+
requestAF(() => {
120+
this.isShown = true
121+
})
117122
}
118123
}
119124
},

0 commit comments

Comments
 (0)
0