diff --git a/packages/scratch-gui/src/components/controls/controls.jsx b/packages/scratch-gui/src/components/controls/controls.jsx index 12b2885c1f..0dfe6489ad 100644 --- a/packages/scratch-gui/src/components/controls/controls.jsx +++ b/packages/scratch-gui/src/components/controls/controls.jsx @@ -29,6 +29,7 @@ const Controls = function (props) { onGreenFlagClick, onStopAllClick, turbo, + isFullScreen, ...componentProps } = props; const intl = useIntl(); @@ -41,11 +42,13 @@ const Controls = function (props) { active={active} title={intl.formatMessage(messages.goTitle)} onClick={onGreenFlagClick} + isFullScreen={isFullScreen} /> {turbo ? ( @@ -55,6 +58,7 @@ const Controls = function (props) { }; Controls.propTypes = { + isFullScreen: PropTypes.bool, active: PropTypes.bool, className: PropTypes.string, onGreenFlagClick: PropTypes.func.isRequired, diff --git a/packages/scratch-gui/src/components/direction-picker/direction-picker.jsx b/packages/scratch-gui/src/components/direction-picker/direction-picker.jsx index 55c1a0dabd..afe0b58b83 100644 --- a/packages/scratch-gui/src/components/direction-picker/direction-picker.jsx +++ b/packages/scratch-gui/src/components/direction-picker/direction-picker.jsx @@ -14,6 +14,7 @@ import styles from './direction-picker.css'; import allAroundIcon from './icon--all-around.svg'; import leftRightIcon from './icon--left-right.svg'; import dontRotateIcon from './icon--dont-rotate.svg'; +import useFocusOutside from '../../hooks/useFocusOutside.js'; const BufferedInput = BufferedInputHOC(Input); @@ -51,15 +52,19 @@ const messages = defineMessages({ const DirectionPicker = props => { const intl = useIntl(); + + const {containerRef, popoverRef} = useFocusOutside(props.onClosePopover); + return (