Support desktop touchscreens for timelines (#11241)

* support desktop touchscreens

* remove placeholder select

* add max height to settings cameras dropdown
This commit is contained in:
Josh Hawkins
2024-05-04 22:00:33 -05:00
committed by GitHub
parent ad87f5786e
commit ca8ef70096
5 changed files with 7 additions and 34 deletions

View File

@@ -1,14 +1,5 @@
import Heading from "@/components/ui/heading";
import { Label } from "@/components/ui/label";
import {
Select,
SelectContent,
SelectGroup,
SelectItem,
SelectLabel,
SelectTrigger,
SelectValue,
} from "@/components/ui/select";
import { Switch } from "@/components/ui/switch";
import { useEffect } from "react";
@@ -24,22 +15,6 @@ export default function General() {
<Switch id="lowdata" checked={false} onCheckedChange={() => {}} />
<Label htmlFor="lowdata">Low Data Mode (this device only)</Label>
</div>
<div className="flex items-center space-x-2 mt-5">
<Select>
<SelectTrigger className="w-[180px]">
<SelectValue placeholder="Another General Option" />
</SelectTrigger>
<SelectContent>
<SelectGroup>
<SelectLabel>Live Mode</SelectLabel>
<SelectItem value="jsmpeg">JSMpeg</SelectItem>
<SelectItem value="mse">MSE</SelectItem>
<SelectItem value="webrtc">WebRTC</SelectItem>
</SelectGroup>
</SelectContent>
</Select>
</div>
</>
);
}

View File

@@ -9,7 +9,6 @@ import {
import { SummarySegment } from "./SummarySegment";
import { useTimelineUtils } from "@/hooks/use-timeline-utils";
import { ReviewSegment, ReviewSeverity } from "@/types/review";
import { isMobile } from "react-device-detect";
export type SummaryTimelineProps = {
reviewTimelineRef: RefObject<HTMLDivElement>;
@@ -188,7 +187,7 @@ export function SummaryTimeline({
e.stopPropagation();
let clientY;
if (isMobile && e.nativeEvent instanceof TouchEvent) {
if (e.nativeEvent instanceof TouchEvent) {
clientY = e.nativeEvent.touches[0].clientY;
} else if (e.nativeEvent instanceof MouseEvent) {
clientY = e.nativeEvent.clientY;
@@ -239,7 +238,7 @@ export function SummaryTimeline({
setIsDragging(true);
let clientY;
if (isMobile && e.nativeEvent instanceof TouchEvent) {
if (e.nativeEvent instanceof TouchEvent) {
clientY = e.nativeEvent.touches[0].clientY;
} else if (e.nativeEvent instanceof MouseEvent) {
clientY = e.nativeEvent.clientY;
@@ -277,7 +276,7 @@ export function SummaryTimeline({
}
e.stopPropagation();
let clientY;
if (isMobile && e instanceof TouchEvent) {
if (e instanceof TouchEvent) {
clientY = e.touches[0].clientY;
} else if (e instanceof MouseEvent) {
clientY = e.clientY;