visjs / vis-timeline

📅 Create a fully customizable, interactive timelines and 2d-graphs with items and ranges.
https://visjs.github.io/vis-timeline/
Other
1.74k stars 302 forks source link

Problem Editing Entries that are also extendable #1778

Open NReib opened 3 months ago

NReib commented 3 months ago

Movable entries of a timeline have a small overlay on the right and left edge that can be used to extend the duration of the entry. When this area is double-clicked in order to edit the entry, instead of firing onUpdate, the onAdd-Event is fired.

Is this expected behaviour like in a copy function or is it a bug?

NReib commented 3 months ago

To me it seems like the event handler is missing on the dragRight / dragLeft Element

I manually added them by copying it from the dragCenter Element.

                let me = this;
            this.hammerDragRight.on('tap', function (event) {
              me.parent.itemSet.body.emitter.emit('click', {
                event: event,
                item: me.id
              });
            });
            this.hammerDragRight.on('doubletap', function (event) {
              event.stopPropagation();
              me.parent.itemSet._onUpdateItem(me);
              me.parent.itemSet.body.emitter.emit('doubleClick', {
                event: event,
                item: me.id
              });
            });