Skip to content

Commit

Permalink
fix(Image): shape not working without explicit image height (#567)
Browse files Browse the repository at this point in the history
fix(image): fix offsetHeight incorrect calculation because of visibility
  • Loading branch information
mbove-square committed Nov 3, 2023
1 parent 83db073 commit 47a5057
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/Image/src/Image.vue
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,9 @@ export default {
onLoaded() {
this.loaded = true;
this.getImageDimensions();
// We can't get the proper height of the image until after the DOM has been updated
// The image will otherwise be hidden, and the offsetHeight will be 0
this.$nextTick(() => this.getImageDimensions());
},
},
};
Expand Down

0 comments on commit 47a5057

Please sign in to comment.