From f2eb4535af845837fb1a4ab5e8c2f34cb2a7a593 Mon Sep 17 00:00:00 2001 From: NikolaBorislavovHristov Date: Mon, 12 Aug 2019 19:24:48 +0300 Subject: [PATCH] onscroll event bubble --- src/App/App.js | 19 ++++++++++++++----- src/App/styles.less | 7 ++++++- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/src/App/App.js b/src/App/App.js index fb8ad8217..8dba04d7c 100644 --- a/src/App/App.js +++ b/src/App/App.js @@ -8,6 +8,13 @@ const App = () => { const onPathNotMatch = React.useCallback(() => { window.history.back(); }, []); + const onScroll = React.useCallback((event) => { + const scrollEvent = new UIEvent('scroll'); + for (const prop in event.nativeEvent) { + scrollEvent[prop] = event.nativeEvent[prop]; + } + window.dispatchEvent(scrollEvent); + }, []); const services = React.useMemo(() => ({ keyboardNavigation: new KeyboardNavigation() }), []); @@ -17,11 +24,13 @@ const App = () => { return ( - +
+ +
); diff --git a/src/App/styles.less b/src/App/styles.less index ca6ab8ea0..353188b91 100644 --- a/src/App/styles.less +++ b/src/App/styles.less @@ -82,9 +82,14 @@ html { overflow: auto; } - .routes-container { + .app-content { width: 100%; height: 100%; + + .routes-container { + width: 100%; + height: 100%; + } } ::-webkit-scrollbar {