You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.
Fabric Image renders an image within a div. When it receives an imageFit prop, the image is displayed absolutely within the div and the div doesn't actually have any dimension unless we provided a height and width.
This makes responsive images impossible to achieve at the moment while using imageFit. Height and width accept a number px value only, allowing a percent or "auto" will not solve this because the wrapping div can't maintain an aspect ratio.
One solution could be to support a new aspectRatio prop. If provided, this could set width: 100% and height: 0, with paddingTop: ${aspectRatio * 100}%
The text was updated successfully, but these errors were encountered:
Fabric Image renders an image within a div. When it receives an imageFit prop, the image is displayed absolutely within the div and the div doesn't actually have any dimension unless we provided a height and width.
This makes responsive images impossible to achieve at the moment while using imageFit. Height and width accept a number px value only, allowing a percent or "auto" will not solve this because the wrapping div can't maintain an aspect ratio.
One solution could be to support a new
aspectRatio
prop. If provided, this could set width: 100% and height: 0, with paddingTop:${aspectRatio * 100}%
The text was updated successfully, but these errors were encountered: