Error
amitguptagwl opened this issue · comments
Amit K Gupta commented
When I use the svg.select.min.js
linked on demo page then it gives me error
svg.select.min.js:4 Uncaught TypeError: a.parent._parent is not a function
at new b (svg.select.min.js:4)
at e.select (svg.select.min.js:4)
If use latest svg.select.min.js
given in dist folder on project roort
Uncaught TypeError: myCanvas.rect(...).select is not a function
Code
myCanvas = new SVG('work-canvas').size(500,500);
var rect = myCanvas.rect(45,300).select();
Ulrich-Matthias Schäfer commented
In the readme of this repo is written, that the method name was changed due to naming conflicts with svg.js. Its now selectize()
.
Beside that you better dont use old code from some demo :D.
Amit K Gupta commented
Ah! Thanks for quick response. I'll raise a PR to update the demo.
BTW what would be the better way to select an element at runtime? I'm using this approach;
rect.on("click", function() {
rect.selectize().resize();
});
Which works fine. But I'm not sure how to deselect them.
Amit K Gupta commented
My bad. I again referred the demo but found in docs