From 7038242d78bbcacf778081796096a89dd0291417 Mon Sep 17 00:00:00 2001 From: Rick Zhou Date: Sun, 12 Dec 2021 16:58:46 -0800 Subject: [PATCH] make sure startIndex <= endIndex --- src/hooks/useVisibleRange.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/hooks/useVisibleRange.ts b/src/hooks/useVisibleRange.ts index 7f665479..e6c865cc 100644 --- a/src/hooks/useVisibleRange.ts +++ b/src/hooks/useVisibleRange.ts @@ -57,7 +57,10 @@ export default function useVisibleRange( break; } } - + if (startIndex > endIndex) { + endIndex = startIndex; + } + return [startIndex, endIndex]; }, [ tabOffsets,