From 200332be966a0ee40a98953715155d61f10832e3 Mon Sep 17 00:00:00 2001 From: Paul Kaplan <pkaplan@media.mit.edu> Date: Mon, 21 May 2018 11:17:11 -0400 Subject: [PATCH] Do not set transforms at scale: 1, fixing the context menu. --- src/components/monitor-list/monitor-list.jsx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/components/monitor-list/monitor-list.jsx b/src/components/monitor-list/monitor-list.jsx index 2af0a8fb8..5cb114241 100644 --- a/src/components/monitor-list/monitor-list.jsx +++ b/src/components/monitor-list/monitor-list.jsx @@ -10,7 +10,12 @@ import styles from './monitor-list.css'; const stageSizeToTransform = ({width, height, widthDefault, heightDefault}) => { const scaleX = width / widthDefault; const scaleY = height / heightDefault; - return `scale(${scaleX},${scaleY})`; + if (scaleX === 1 && scaleY === 1) { + // Do not set a transform if the scale is 1 because + // it messes up `position: fixed` elements like the context menu. + return; + } + return {transform: `scale(${scaleX},${scaleY})`}; }; const MonitorList = props => ( @@ -24,9 +29,7 @@ const MonitorList = props => ( > <Box className={styles.monitorListScaler} - style={{ - transform: stageSizeToTransform(props.stageSize) - }} + style={stageSizeToTransform(props.stageSize)} > {props.monitors.valueSeq().filter(m => m.visible) .map(monitorData => ( -- GitLab