From e69b4eec51743b68fd47b6d117afe13d97eb415f Mon Sep 17 00:00:00 2001 From: Erik Ritter Date: Fri, 5 Nov 2021 11:12:30 -0700 Subject: [PATCH] fix: Remove horizontal scroll navigation from SQL Lab (#17356) --- superset-frontend/src/SqlLab/components/App/index.jsx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/superset-frontend/src/SqlLab/components/App/index.jsx b/superset-frontend/src/SqlLab/components/App/index.jsx index 97871ba9f3d15..406ad740bd5c4 100644 --- a/superset-frontend/src/SqlLab/components/App/index.jsx +++ b/superset-frontend/src/SqlLab/components/App/index.jsx @@ -50,6 +50,11 @@ class App extends React.PureComponent { componentDidMount() { window.addEventListener('hashchange', this.onHashChanged.bind(this)); + + // Horrible hack to disable side swipe navigation when in SQL Lab. Even though the + // docs say setting this style on any div will prevent it, turns out it only works + // when set on the body element. + document.body.style.overscrollBehaviorX = 'none'; } componentDidUpdate() { @@ -65,6 +70,9 @@ class App extends React.PureComponent { componentWillUnmount() { window.removeEventListener('hashchange', this.onHashChanged.bind(this)); + + // And now we need to reset the overscroll behavior back to the default. + document.body.style.overscrollBehaviorX = 'auto'; } onHashChanged() {