Image shape circle and arch were not working without defining an explicit height for the image. This was because the onLoaded method being used to set the image height and width was being triggered in the same update cycle as loaded. Because we are using v-show="loaded" the element has not yet appeared in the DOM so the offsetHeight will always be 0. You can see in the screenshot that the shape is actually applied, once the resize method has been triggered and the element is actually visible.
Describe the problem this PR addresses
circle
andarch
were not working without defining an explicit height for the image. This was because theonLoaded
method being used to set the imageheight
andwidth
was being triggered in the same update cycle asloaded
. Because we are usingv-show="loaded"
the element has not yet appeared in the DOM so theoffsetHeight
will always be 0. You can see in the screenshot that the shape is actually applied, once the resize method has been triggered and the element is actually visible.https://github.com/square/maker/assets/82115556/0d93cbb3-323a-4af5-94c6-04551b95ca4a
Describe the changes in this PR
offsetHeight
is only retrieved after the DOM has had a chance to update and the image is actually visibleOther information