We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f2a4e3d commit 44f7ceaCopy full SHA for 44f7cea
src/index.tsx
@@ -220,13 +220,21 @@ const NextTopLoader = ({
220
NProgress.done();
221
}
222
223
+ function handlePageHide() {
224
+ NProgress.done();
225
+ [].forEach.call(npgclass, function (el: Element) {
226
+ el.classList.remove('nprogress-busy');
227
+ });
228
+ }
229
230
// Add the global click event listener
231
document.addEventListener('click', handleClick);
232
+ window.addEventListener('pagehide', handlePageHide);
233
234
// Clean up the global click event listener when the component is unmounted
235
return () => {
236
document.removeEventListener('click', handleClick);
237
+ window.removeEventListener('pagehide', handlePageHide);
238
};
239
}, []);
240
0 commit comments