react-zoom-pan-pinch icon indicating copy to clipboard operation
react-zoom-pan-pinch copied to clipboard

Pan on x-axis doesn't work

Open sikandarchishty opened this issue 3 years ago • 2 comments

Hi, I have a very wide div, basically I am making a Family Hierarchy so it will get as wider as possible. However, for a very wide Div, I cannot pan on x-axis.

CodeSandbox

The only it Pan on X-axis works is if its zoomed-in and then you can pan left and right.

The styles are a bit off here but I guess its irrelevant for this issue.

sikandarchishty avatar Feb 22 '22 15:02 sikandarchishty

+1. Any solutions found so far?

amitgaikwad1031996 avatar Feb 24 '22 11:02 amitgaikwad1031996

Up

paolojulian avatar Oct 05 '22 07:10 paolojulian

Issue is related to the .react-transform-wrapper width. You need to control it with max-width so it will fit in the screen.

Solution:

.react-transform-wrapper {
   max-width: calc(100vw - 80px);
}

prc5 avatar Feb 05 '23 10:02 prc5