autodesk-viewer

Autodesk viewer Zoom handler


I face an issue with zoom handler. Sometimes when i start viewer zoom handler zoom to the top of canvas, not to cursor position. After browser window resize or page refresh it fixes. It happens not often, but i don't understand the reason of this behavior and how to prevent this issue.

I try to reapply NOP_VIEWER.toolController.mousewheel on div container with addEventListener on parent container which size is the same as viewer-adsk-container, but it changes nothing.

I don't understand which part of code i should share in this case, please advise if needed.

Also i use viewer v7.105.

Thank you in advance.

UPD:

When this issue occurs - click is not working too. I cannot select any item in view. I work with viewer 1+ year and never met this issues before.


Solution

  • It seems that the issue was in mounting spiner container as neighbour of viewer container when model is not loaded. I remove that spiner and issue is not fires again.

    I assume that this spinner shifted viewer container out of viewport and all handlers inside the viewer are trying to use those negative canvasY values from container which was out of viewport.

    Below you can see my return from React component with viewer. I removed {!modelLoaded && <IdleLoader />} and after that i cannot reproduce this issue.

      return (
        <>
          {!modelLoaded && <IdleLoader />}
          <div ref={container}></div>
        </>
      );