Use "BasePager" for infinite scroll chapter change detection
There can be cases where when scrolling backward/forward the first/last page never gets visible in the viewport due to a large width/height of another page. In that case the intersection observer would never trigger and thus, the chapter wouldn't get changed. By using the Pager, which always takes up the full width/height, this problem will not be possible, since the start/end of the Pager always enters or leaves the viewport.
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
import { ComponentType, MemoExoticComponent } from 'react';
|
||||
import { ForwardRefExoticComponent, MemoExoticComponent, RefAttributes } from 'react';
|
||||
import {
|
||||
IReaderSettings,
|
||||
IReaderSettingsWithDefaultFlag,
|
||||
@@ -59,7 +59,7 @@ export const isAutoWebtoonMode = (
|
||||
|
||||
export const getPagerForReadingMode = (
|
||||
readingMode: ReadingMode,
|
||||
): MemoExoticComponent<ComponentType<ReaderPagerProps>> => {
|
||||
): MemoExoticComponent<ForwardRefExoticComponent<ReaderPagerProps & RefAttributes<HTMLDivElement>>> => {
|
||||
switch (readingMode) {
|
||||
case ReadingMode.SINGLE_PAGE:
|
||||
return ReaderPagedPager;
|
||||
|
||||
Reference in New Issue
Block a user