visjs / vis-data

🗄️ Manage unstructured data using DataSet. Add, update, and remove data, and listen for changes in the data.
https://visjs.github.io/vis-data/
102 stars 20 forks source link

Object prototype is lost on call to `updateOnly` #997

Open dermotduffy opened 1 year ago

dermotduffy commented 1 year ago

A call to updateOnly on an existing item appears to lose the object prototype associated with the data. This Chrome debugging screenshot should illustrate the issue:

visjs

dermotduffy commented 1 year ago

Workaround is to remove then add:

Screenshot from 2022-12-31 14-25-30

alexdeia commented 1 year ago

Also you can use just update method. See https://github.com/visjs/vis-data/issues/1014 and https://github.com/visjs/vis-data/issues/1015