I want to create a "select and group" functionality for my KonvaJS application.
For the select functionality, I'm using this example that works well: selecting by drawing a box around objects in konva
But the group function is not working as I expect. This is what's happening:
First I create an empty group like this:
selectGroup = new Konva.Group({
x: 50,
y: 50,
draggable: true
});
When a shape is hit I add it like this:
selectGroup.add(shapeObject);
And when I finish the selection I call the Transform functionality like this:
var tr = new Konva.Transformer();
layer.add(tr);
tr.attachTo(selectGroup);
layer.draw();
I don't why when I add a shape it disappears. And when I finish and I call the transform functionality it doesn't seem to be working.
Any ideas?