You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
The library lacks some common exposed variables, that would be hugely useful for:
Disabling panning, zoom on conditions;
Doing actions when items are zoomed in
Describe the solution you'd like
Expose additional variables, like isPanning, isZoomed, scale etc. in the useControls Hook and on the ref object.
It seems that ts types already include those in a state field, but it is only populated in the events, and not on the main ref obect in this configuration:
// transformWrapperRef.current?.state object is always undefined hereconsttransformWrapperRef=useRef<ReactZoomPanPinchRef|null>(null);<TransformWrapperref={transformWrapperRef}><TransformComponent><imgsrc={image}/></TransformComponent></TransformWrapper>
Describe alternatives you've considered
Using event handlers like onPanning and onZoom to set a boolean state for isZoomedIn. Requires additional event throttling, and, to my mind is generally a worse solution. (because onZoom seems to not always fire on first double tap, and isPanning is firing every pixel moved)
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
The library lacks some common exposed variables, that would be hugely useful for:
Disabling panning, zoom on conditions;
Doing actions when items are zoomed in
Describe the solution you'd like
Expose additional variables, like
isPanning
,isZoomed
,scale
etc. in theuseControls
Hook and on theref
object.It seems that ts types already include those in a
state
field, but it is only populated in the events, and not on the main ref obect in this configuration:Describe alternatives you've considered
Using event handlers like onPanning and onZoom to set a boolean state for
isZoomedIn
. Requires additional event throttling, and, to my mind is generally a worse solution. (because onZoom seems to not always fire on first double tap, and isPanning is firing every pixel moved)The text was updated successfully, but these errors were encountered: