mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-02-02 00:18:08 +00:00
refactor(tv): remove auto-scroll behaviors from search and series
This commit is contained in:
@@ -41,11 +41,8 @@ export const TVSearchSection: React.FC<TVSearchSectionProps> = ({
|
||||
const [focusedCount, setFocusedCount] = useState(0);
|
||||
const prevFocusedCount = useRef(0);
|
||||
|
||||
// When section loses all focus, scroll back to start
|
||||
// Track focus count for section
|
||||
useEffect(() => {
|
||||
if (prevFocusedCount.current > 0 && focusedCount === 0) {
|
||||
flatListRef.current?.scrollToOffset({ offset: 0, animated: true });
|
||||
}
|
||||
prevFocusedCount.current = focusedCount;
|
||||
}, [focusedCount]);
|
||||
|
||||
|
||||
@@ -252,11 +252,8 @@ export const TVSeriesPage: React.FC<TVSeriesPageProps> = ({
|
||||
const [focusedCount, setFocusedCount] = useState(0);
|
||||
const prevFocusedCount = useRef(0);
|
||||
|
||||
// Scroll back to start when episode list loses focus
|
||||
// Track focus count for episode list
|
||||
useEffect(() => {
|
||||
if (prevFocusedCount.current > 0 && focusedCount === 0) {
|
||||
episodeListRef.current?.scrollTo({ x: 0, animated: true });
|
||||
}
|
||||
prevFocusedCount.current = focusedCount;
|
||||
}, [focusedCount]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user