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
Issue introduced with vis-timeline since v6.4.3, specifically commit 2861085 dealing with issue #202
Issue description
On double clicking an item, no onDoubleclick event is triggered/exposed, and the console shows the following error: ERROR TypeError: Cannot read property 'itemSet' of undefined
Important detail: we have updateTime option set to true, whilst updateGroup is set to False
Analysis:
My best guess, is that above commit is not the root cause but highlights a different problem.
In the repaintDragCenter() method, onUpdateItem is called to update the item, before a doubleClick is emitted. The onUpdateItem function however, returns a rangeItem without parent value, which then breaks the code below the call, that would emit the doubleclick event.
It breaks because it tries to access me.parent, whilst the cloned item doesn't contain a parent value.
The reason that this used to work for us before the commit mentioned above, is that we have updateTime option set to true, whilst updateGroup is set to False. In the older situation, this would cause _onUpdateItem to immediately break out of the method. This way, it didn't get a clone of the data from the dataset without parent value, and me still refered to the object with a parent value set. So in the old scenario, the repaintDragCenter would still work as 'expected' without in fact actually updating the item.
Solutions
I'm not familiar enough with vis to determine the best way to address this otherwise I'd have created a PR instead. Assuming this in a bug in vis-timeline and not an fault of our ouple of ideas:
Remove me.parent.itemSet._onUpdateItem(me); line from _repaintDragCenter method
Let theme.itemsData.get(item.id); inside _onUpdateItem return an cloned object with parent value set
revert the above commit
?
The text was updated successfully, but these errors were encountered:
@yotamberk I'm sorry for the delay.
I tried to make an example but couldn't reproduce it initially.
In short, it turns out that we have listeners on changes in the state of the timeline, which re-sets (instead of updates) the visData with the setData method. This is triggered by the _onUpdateItem call in Vis. Which is why the parent value is unset in the midst of the repaintDragCenter method. We'll address this in our application.
If you find it worthwhile, I could find some time to make a reproducible example next week, but it doesn't seem like a bug in Vis after all. I'll close the issue.
Issue introduced with vis-timeline since v6.4.3, specifically commit 2861085 dealing with issue #202
Issue description
On double clicking an item, no
onDoubleclick
event is triggered/exposed, and the console shows the following error:ERROR TypeError: Cannot read property 'itemSet' of undefined
Important detail: we have
updateTime
option set totrue
, whilstupdateGroup
is set to FalseAnalysis:
My best guess, is that above commit is not the root cause but highlights a different problem.
In the
repaintDragCenter()
method,onUpdateItem
is called to update the item, before adoubleClick
is emitted. TheonUpdateItem
function however, returns a rangeItem withoutparent
value, which then breaks the code below the call, that would emit thedoubleclick
event.It breaks because it tries to access
me.parent
, whilst the cloned item doesn't contain aparent
value.The reason that this used to work for us before the commit mentioned above, is that we have
updateTime
option set totrue
, whilstupdateGroup
is set to False. In the older situation, this would cause_onUpdateItem
to immediately break out of the method. This way, it didn't get a clone of the data from the dataset withoutparent
value, andme
still refered to the object with aparent
value set. So in the old scenario, therepaintDragCenter
would still work as 'expected' without in fact actually updating the item.Solutions
I'm not familiar enough with vis to determine the best way to address this otherwise I'd have created a PR instead. Assuming this in a bug in vis-timeline and not an fault of our ouple of ideas:
me.parent.itemSet._onUpdateItem(me);
line from_repaintDragCenter
methodme.itemsData.get(item.id);
inside_onUpdateItem
return an cloned object withparent
value setThe text was updated successfully, but these errors were encountered: