diff options
author | eug-vs <eug-vs@keemail.me> | 2020-09-21 21:44:29 +0300 |
---|---|---|
committer | eug-vs <eug-vs@keemail.me> | 2020-09-21 21:44:29 +0300 |
commit | 172bc0155f0ad70d046db3151539715ee1690678 (patch) | |
tree | 8c223cb42e90afc2e124ca231af1d79e113500a5 | |
parent | 08802fc982328b3c99cc4d4c2a0bec8eeea4c8dc (diff) | |
download | which-ui-172bc0155f0ad70d046db3151539715ee1690678.tar.gz |
fix: get rid of nasty aspect ratio bug
-rw-r--r-- | src/components/Image/BackgroundImage.tsx | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/components/Image/BackgroundImage.tsx b/src/components/Image/BackgroundImage.tsx index e749d10..7d8e6e2 100644 --- a/src/components/Image/BackgroundImage.tsx +++ b/src/components/Image/BackgroundImage.tsx @@ -11,13 +11,14 @@ const useStyles = makeStyles({ root: { position: 'absolute', width: '100%', - height: '100%' + height: '100%', + overflow: 'hidden' }, image: { objectFit: 'cover', pointerEvents: 'none', width: '100%', - height: '100%' + minHeight: '100%' } }); @@ -25,9 +26,9 @@ const BackgroundImage: React.FC<PropTypes> = ({ src, alt }) => { const classes = useStyles(); return ( - <picture className={classes.root}> + <div className={classes.root}> <Image src={src} alt={alt} className={classes.image} /> - </picture> + </div> ); }; |