Reset scroll position when changing the search term (#382)

I hate my life (f5a8c8d35c)... AINTNOWAY
This commit is contained in:
schroda
2023-06-20 01:12:10 +02:00
committed by GitHub
parent 322cf8c915
commit ed9c51cd37

View File

@@ -256,6 +256,7 @@ export default function SourceMangas() {
// with strict mode + dev mode the first request will be aborted. due to using SWR there won't be an // with strict mode + dev mode the first request will be aborted. due to using SWR there won't be an
// immediate second request since it's the same key. instead the "second" request will be the error handling of SWR // immediate second request since it's the same key. instead the "second" request will be the error handling of SWR
abortRequest(new Error(`SourceMangas(${sourceId}): search string changed`)); abortRequest(new Error(`SourceMangas(${sourceId}): search string changed`));
setResetScrollPosition(true);
}, },
[searchTerm, contentType], [searchTerm, contentType],
); );