Skip to content

Commit 5566d44

Browse files
gatsbybotwardpeetLekoArts
authored
fix(gatsby-plugin-image): fix race condition (#35635) (#35640)
Co-authored-by: Ward Peeters <[email protected]> Co-authored-by: LekoArts <[email protected]>
1 parent 2c324f6 commit 5566d44

File tree

2 files changed

+5
-23
lines changed

2 files changed

+5
-23
lines changed

packages/gatsby-plugin-image/src/components/layout-wrapper.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ if (hasNativeLazyLoadSupport) {
3434
3535
if (mainImage.complete) {
3636
mainImage.style.opacity = 1;
37+
38+
// also hide the placeholder
39+
mainImage.parentNode.parentNode.querySelector('[data-placeholder-image]').style.opacity = 0;
3740
}
3841
}
3942
}

yarn.lock

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -11846,7 +11846,7 @@ fs-extra@^1.0.0:
1184611846
jsonfile "^2.1.0"
1184711847
klaw "^1.0.0"
1184811848

11849-
fs-extra@^10.0.0, fs-extra@^10.1.0:
11849+
fs-extra@^10.1.0:
1185011850
version "10.1.0"
1185111851
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-10.1.0.tgz#02873cfbc4084dde127eaa5f9905eef2325d1abf"
1185211852
integrity sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==
@@ -11925,27 +11925,6 @@ gather-stream@^1.0.0:
1192511925
version "1.0.0"
1192611926
resolved "https://registry.yarnpkg.com/gather-stream/-/gather-stream-1.0.0.tgz#b33994af457a8115700d410f317733cbe7a0904b"
1192711927

11928-
gatsby-core-utils@^3.8.2:
11929-
version "3.8.2"
11930-
resolved "https://registry.yarnpkg.com/gatsby-core-utils/-/gatsby-core-utils-3.8.2.tgz#9c2869f93a740d20536b1e92c8020efd85d43e5f"
11931-
integrity sha512-UwANr9yd8ayLinPDoRbU/rRgoOBOS715qe2LYCxq6hAtRabHWTEM8Vj0wh7LmyVGexx8MFgvp2NKikG2TZ5pzQ==
11932-
dependencies:
11933-
"@babel/runtime" "^7.15.4"
11934-
ci-info "2.0.0"
11935-
configstore "^5.0.1"
11936-
fastq "^1.13.0"
11937-
file-type "^16.5.3"
11938-
fs-extra "^10.0.0"
11939-
got "^11.8.3"
11940-
import-from "^4.0.0"
11941-
lmdb "^2.1.7"
11942-
lock "^1.1.0"
11943-
node-object-hash "^2.3.10"
11944-
proper-lockfile "^4.1.2"
11945-
resolve-from "^5.0.0"
11946-
tmp "^0.2.1"
11947-
xdg-basedir "^4.0.0"
11948-
1194911928
gauge@~2.7.3:
1195011929
version "2.7.4"
1195111930
resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7"
@@ -15719,7 +15698,7 @@ livereload-js@^2.3.0:
1571915698
version "2.3.0"
1572015699
resolved "https://registry.yarnpkg.com/livereload-js/-/livereload-js-2.3.0.tgz#c3ab22e8aaf5bf3505d80d098cbad67726548c9a"
1572115700

15722-
lmdb@^2.0.2, lmdb@^2.1.7, lmdb@^2.2.6, lmdb@~2.2.3:
15701+
lmdb@^2.0.2, lmdb@^2.2.6, lmdb@~2.2.3:
1572315702
version "2.2.6"
1572415703
resolved "https://registry.yarnpkg.com/lmdb/-/lmdb-2.2.6.tgz#a52ef533812b8abcbe0033fc9d74d215e7dfc0a0"
1572515704
integrity sha512-UmQV0oZZcV3EN6rjcAjIiuWcc3MYZGWQ0GUYz46Ron5fuTa/dUow7WSQa6leFkvZIKVUdECBWVw96tckfEzUFQ==

0 commit comments

Comments
 (0)