moveable icon indicating copy to clipboard operation
moveable copied to clipboard

Is there a way to get the properties for an svg element from the events?

Open isaacfink opened this issue 6 months ago • 1 comments

I need to get the correct properties like the new left and top values, are those part of the events or do I need to calculate based on the ratio between the svg size and the page?

isaacfink avatar Jun 16 '25 19:06 isaacfink

Hi @isaacfink, have you been able to figure this out? Maybe if you can mention precisely what event are you listening to but this is how I am managing mine, I am using transform, and there's also drag where you can get your top and left offsets.

onDrag={(e) => {
          e.target.style.transform = e.transform;
          const blockId = e.target.getAttribute('data-id');
          if (!blockId) return;
          const { x, y, rotate } = parseTransform(e.transform);
        }}

SixtusOnyedibe avatar Aug 05 '25 14:08 SixtusOnyedibe