Use modal on dropdowns for mobile only (#11993)

This commit is contained in:
Josh Hawkins 2024-06-16 12:58:28 -06:00 committed by GitHub
parent f1bb797fe0
commit 89a478ce0a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 6 additions and 6 deletions

View File

@ -468,7 +468,7 @@ export function CameraGroupRow({
{isMobile && (
<>
<DropdownMenu modal={false}>
<DropdownMenu modal={!isDesktop}>
<DropdownMenuTrigger>
<HiOutlineDotsVertical className="size-5" />
</DropdownMenuTrigger>

View File

@ -1,5 +1,5 @@
import { useCallback, useMemo, useRef, useState } from "react";
import { isMobileOnly, isSafari } from "react-device-detect";
import { isDesktop, isMobileOnly, isSafari } from "react-device-detect";
import { LuPause, LuPlay } from "react-icons/lu";
import {
DropdownMenu,
@ -242,7 +242,7 @@ export default function VideoControls({
)}
{features.playbackRate && (
<DropdownMenu
modal={false}
modal={!isDesktop}
onOpenChange={(open) => {
if (setControlsOpen) {
setControlsOpen(open);

View File

@ -19,7 +19,7 @@ import { LuCopy, LuPencil } from "react-icons/lu";
import { FaDrawPolygon, FaObjectGroup } from "react-icons/fa";
import { BsPersonBoundingBox } from "react-icons/bs";
import { HiOutlineDotsVertical, HiTrash } from "react-icons/hi";
import { isMobile } from "react-device-detect";
import { isDesktop, isMobile } from "react-device-detect";
import {
flattenPoints,
parseCoordinates,
@ -266,7 +266,7 @@ export default function PolygonItem({
{isMobile && (
<>
<DropdownMenu modal={false}>
<DropdownMenu modal={!isDesktop}>
<DropdownMenuTrigger>
<HiOutlineDotsVertical className="size-5" />
</DropdownMenuTrigger>

View File

@ -620,7 +620,7 @@ function PtzControlPanel({
</>
)}
{(ptz?.presets?.length ?? 0) > 0 && (
<DropdownMenu modal={false}>
<DropdownMenu modal={!isDesktop}>
<DropdownMenuTrigger asChild>
<Button>
<BsThreeDotsVertical />