1
0
mirror of https://github.com/kamranahmedse/developer-roadmap.git synced 2025-09-01 13:22:38 +02:00

Reset pinch zoom on click of resource

This commit is contained in:
Kamran Ahmed
2022-08-19 22:58:56 +04:00
parent 043a4c9684
commit 8c910bce70
2 changed files with 6 additions and 1 deletions

View File

@@ -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 = {

View File

@@ -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) {