File tree 2 files changed +5
-8
lines changed
2 files changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -2,11 +2,9 @@ import './src/styles/main.css';
2
2
3
3
// eslint-disable-next-line import/prefer-default-export
4
4
export const onRouteUpdate = ( { location } ) => {
5
- console . log ( 'on route update' ) ;
6
-
7
- // Find all .gatsby-image-wrapper [data-main-image] elements check if they are are already loaded
8
- // If yes, add the class 'loaded' to the element
9
- // If no, add a listener to the element to add the class 'loaded' when the image is loaded
5
+ // TODO: Fix of gatsby-plugin-image bug, that prevents images from being displayed
6
+ // It happens because gatsby does not trigger a function that sets to an element opacity: 1
7
+ // Bug is very hard to reproduce, it happens only in production builds
10
8
11
9
const mainImages = document . querySelectorAll ( '.gatsby-image-wrapper [data-main-image]' ) ;
12
10
mainImages . forEach ( ( mainImage ) => {
Original file line number Diff line number Diff line change 9
9
}
10
10
}
11
11
12
- /* TODO: Fix Gatsby bug with images being hidden,the issue is possible to catch only in production build */
13
- /* .gatsby-image-wrapper [data-main-image] {
12
+ .gatsby-image-wrapper .loaded [data-main-image ] {
14
13
opacity : 1 !important ;
15
- } */
14
+ }
You can’t perform that action at this time.
0 commit comments