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
Hi!
I make diagram in web-version draw.io. I add properties for rect (by right click), for example (mydata="something"), and save to SVG.
Next, I add this SVG on web page (Next.JS client component) and add listening events - onMouseClick in JS. I get element by click (event.target) - this is my rect. But it has not element mydata. Why?
This discussion was converted from issue #5354 on November 19, 2025 15:57.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hi!
I make diagram in web-version draw.io. I add properties for rect (by right click), for example (mydata="something"), and save to SVG.
Next, I add this SVG on web page (Next.JS client component) and add listening events - onMouseClick in JS. I get element by click (event.target) - this is my rect. But it has not element mydata. Why?
How to set my data for element in draw.io to get it in web-page in JS?
in console I get:
<rect x="0" y="80" width="120" height="60" rx="9" ry="9" fill="url(#drawio-svg-VJUeQuwQImHvvxXrS3Zj-gradient-light-dark_fff2cc_281d00_-1-light-dark_ff9933_a95100_-1-s-0)" stroke="#d6b656" pointer-events="all" style="fill: url("#drawio-svg-VJUeQuwQImHvvxXrS3Zj-gradient-light-dark_fff2cc_281d00_-1-light-dark_ff9933_a95100_-1-s-0"); stroke: light-dark(rgb(214, 182, 86), rgb(109, 81, 0));"></rect>Thank you!
Beta Was this translation helpful? Give feedback.
All reactions