question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't get disableOnTarget prop working

See original GitHub issue

Hi @prc5,

Thanks for the awesome open source project 😄 I’m trying to get the disableOnTarget option working so that a canvas inside of the wrapper is usable. I was hoping that upon clicking inside the canvas the panning would be disabled. I’m using a fabricjs canvas.

              <TransformWrapper pan={{
                    disabledOnTarget: ["canvas_editor"],
                  }}>
                <TransformComponent>
                  <div className="canvas_editor">
                    <canvas {...css(styles.templateEditor)} id="template_editor" className="" />
                  </div>
                </TransformComponent>
              </TransformWrapper>

Does this look like it should work?

Thanks in advance and cheers!

Kyle

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5

github_iconTop GitHub Comments

3reactions
obrylcommented, Apr 20, 2020

+1 Facing the same issues. Seems like disableOnTarget is not even on interface.

1reaction
obrylcommented, Jun 18, 2020

Got it to work with

const panOptions = {
            disableOnTarget: ['select-area'],
        } as any;

where select-area is css class. Also was needed to add @ts-ignore for pan property definition

Read more comments on GitHub >

github_iconTop Results From Across the Web

disableOnTarget not accepted in pan props as docs say #169
in the Pan props elements a useful disableOnTarget is listed but actually not accepted in version 1.6.1.
Read more >
Applying z-index to only child component does not work
I tried changing the z-index of box B but it didn't work. I also can't set pointerEvents to none because I need mouse...
Read more >
dow-react-zoom-pan-pinch
Props of TransformWrapper ... Pan prop elements ... disableOnTarget, [], array of class names or node tags (div,span...).
Read more >
Removing A Stuck Outboard Propeller - YouTube
Your browser can't play this video. Learn more. Switch camera.
Read more >
Remove a stuck prop nut with electrical tape - YouTube
Uncertain about what to buy? Check out THE ULTIMATE FPV SHOPPING LIST: https://www.fpvknowitall.com/ultimate-fpv-shopping-listSUPPORT ME ON ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found