Reset pinch zoom on click of resource

pull/1657/head
Kamran Ahmed 2 years ago
parent 043a4c9684
commit 8c910bce70
  1. 2
      components/home/featured-roadmaps-list.tsx
  2. 5
      pages/[roadmap]/interactive.tsx

@ -1,5 +1,5 @@
import { RoadmapType } from '../../lib/roadmap';
import { Box, SimpleGrid, Tag } from '@chakra-ui/react';
import { SimpleGrid, Tag } from '@chakra-ui/react';
import { HomeRoadmapItem } from '../roadmap/home-roadmap-item';
type FeaturedRoadmapsListProps = {

@ -52,6 +52,11 @@ export function InteractiveRoadmapRenderer(props: RoadmapProps) {
}
function clickListener(event: MouseEvent) {
const viewPortMeta = document.querySelector('meta[name=viewport]');
if (viewPortMeta) {
viewPortMeta.setAttribute('content', "initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0");
}
const targetGroup = (event?.target as HTMLElement)?.closest('g');
const groupId = targetGroup?.dataset?.groupId;
if (!targetGroup || !groupId) {

Loading…
Cancel
Save