diff --git a/ui/component/app/view.jsx b/ui/component/app/view.jsx index 5c834d2e8..39f3ff860 100644 --- a/ui/component/app/view.jsx +++ b/ui/component/app/view.jsx @@ -161,6 +161,17 @@ function App(props: Props) { return () => window.removeEventListener('mouseup', handleForwardAndBackButtons); }); + // allows user to pause miniplayer using the spacebar without the page scrolling down + useEffect(() => { + const handleKeyPress = e => { + if (e.key === ' ' && e.target === document.body) { + e.preventDefault(); + } + }; + window.addEventListener('keydown', handleKeyPress); + return () => window.removeEventListener('keydown', handleKeyPress); + }); + useEffect(() => { if (referredRewardAvailable && sanitizedReferrerParam && isRewardApproved) { setReferrer(sanitizedReferrerParam, true);