detail stream scrolling fixes for HA/iOS

This commit is contained in:
Josh Hawkins 2025-12-30 15:30:48 -06:00
parent d253b402a4
commit 1eaeb42749

View File

@ -25,10 +25,12 @@ import { Tooltip, TooltipContent, TooltipTrigger } from "../ui/tooltip";
import { Link } from "react-router-dom";
import { Switch } from "@/components/ui/switch";
import { useUserPersistence } from "@/hooks/use-user-persistence";
import { isDesktop } from "react-device-detect";
import { isDesktop, isIOS, isMobile } from "react-device-detect";
import { resolveZoneName } from "@/hooks/use-zone-friendly-name";
import { PiSlidersHorizontalBold } from "react-icons/pi";
import { MdAutoAwesome } from "react-icons/md";
import { isPWA } from "@/utils/isPWA";
import { isInIframe } from "@/utils/isIFrame";
type DetailStreamProps = {
reviewItems?: ReviewSegment[];
@ -113,7 +115,7 @@ export default function DetailStream({
setProgrammaticScroll();
scrollIntoView(element, {
scrollMode: "if-needed",
behavior: "smooth",
behavior: isMobile && isIOS && !isPWA && isInIframe ? "auto" : "smooth",
});
}
}, [activeReviewId, setProgrammaticScroll, userInteracting, isPlaying]);
@ -163,7 +165,8 @@ export default function DetailStream({
setProgrammaticScroll();
scrollIntoView(element, {
scrollMode: "if-needed",
behavior: "smooth",
behavior:
isMobile && isIOS && !isPWA && isInIframe ? "auto" : "smooth",
});
}
}