diff --git a/src/components/monitor/monitor.jsx b/src/components/monitor/monitor.jsx index 77726194d..7be0875e5 100644 --- a/src/components/monitor/monitor.jsx +++ b/src/components/monitor/monitor.jsx @@ -1,4 +1,5 @@ import React from 'react'; +import ReactDOM from 'react-dom'; import PropTypes from 'prop-types'; import Draggable from 'react-draggable'; import {FormattedMessage} from 'react-intl'; @@ -52,7 +53,11 @@ const MonitorComponent = props => ( })} - {props.mode === 'list' ? null : ( + {props.mode === 'list' ? null : ReactDOM.createPortal(( + // Use a portal to render the context menu outside the flow to avoid + // positioning conflicts between the monitors `transform: scale` and + // the context menus `position: fixed`. For more details, see + // http://meyerweb.com/eric/thoughts/2011/09/12/un-fixing-fixed-elements-with-css-transforms/ ( ) : null} - )} + ), document.body)} ); diff --git a/test/integration/blocks.test.js b/test/integration/blocks.test.js index 1f38d79f8..e7fcf0b82 100644 --- a/test/integration/blocks.test.js +++ b/test/integration/blocks.test.js @@ -56,8 +56,7 @@ describe('Working with the blocks', () => { await expect(logs).toEqual([]); }); - // TODO: why is this test failing? - test.skip('Creating variables', async () => { + test('Creating variables', async () => { await loadUri(uri); await clickXpath('//button[@title="tryit"]'); await clickText('Code');