mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-04-05 04:19:55 +00:00
onscroll event bubble
This commit is contained in:
parent
99063753e1
commit
f2eb4535af
2 changed files with 20 additions and 6 deletions
|
|
@ -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 (
|
||||
<React.StrictMode>
|
||||
<ServicesProvider services={services}>
|
||||
<Router
|
||||
homePath={'/'}
|
||||
viewsConfig={routerViewsConfig}
|
||||
onPathNotMatch={onPathNotMatch}
|
||||
/>
|
||||
<div className={'app-content'} onScroll={onScroll}>
|
||||
<Router
|
||||
homePath={'/'}
|
||||
viewsConfig={routerViewsConfig}
|
||||
onPathNotMatch={onPathNotMatch}
|
||||
/>
|
||||
</div>
|
||||
</ServicesProvider>
|
||||
</React.StrictMode>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -82,9 +82,14 @@ html {
|
|||
overflow: auto;
|
||||
}
|
||||
|
||||
.routes-container {
|
||||
.app-content {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
.routes-container {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
::-webkit-scrollbar {
|
||||
|
|
|
|||
Loading…
Reference in a new issue