svgdotjs / svg.select.js

An extension of svg.js which allows to select an element

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error

amitguptagwl opened this issue · comments

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();

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.

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.

My bad. I again referred the demo but found in docs