konvajs / konva

Konva.js is an HTML5 Canvas JavaScript framework that extends the 2d context by enabling canvas interactivity for desktop and mobile applications.
http://konvajs.org/
Other
11.43k stars 918 forks source link

loading json problems #1722

Closed fredalva closed 7 months ago

fredalva commented 7 months ago

Hi, i am new using konva.js , i use prompt to add text which will be displayed in center rectangle.This works well, when i click on rectangle i get alert with shape id. When i click on save , i get text.json file on my download folder. i checked file and all seems good. Problem i coming after upload file, i can see rectangle and move it but no click detected on rectangle, stage also. if i try to add new rectangle on stage nothing happens after prompt submit. test.json This is sample code page to test: `<!DOCTYPE html>

Plan Interactif avec Konva.js

`

lavrton commented 7 months ago

JSON serialization has no information about any event handlers. So after you load from JSON, you have to reattach all listeners for events again.