diff --git a/components/BackgroundSelect.js b/components/BackgroundSelect.js index 5db2899..b32b234 100644 --- a/components/BackgroundSelect.js +++ b/components/BackgroundSelect.js @@ -18,7 +18,7 @@ class BackgroundSelect extends React.PureComponent { handlePickColor = ({ rgb }) => this.props.onChange({ backgroundColor: stringifyRGBA(rgb) }) render() { - const { color, mode, image, onChange, aspectRatio, isVisible, toggleVisibility } = this.props + const { color, mode, image, onChange, isVisible, toggleVisibility, carbonRef } = this.props let background = typeof color === 'string' ? escape(color).replace(/\//g, '/') : color @@ -26,6 +26,8 @@ class BackgroundSelect extends React.PureComponent { background = DEFAULT_BG_COLOR } + const aspectRatio = carbonRef ? carbonRef.clientWidth / carbonRef.clientHeight : 1 + return (