3

I have developed a lightning component, I am using following JavaScript methods
.getComputedTextLength()
.getScreenCTM()
.getTotalLength()
.getBBobx()
I am getting following errors

getComputedTextLength is not a function
getTotalLength is not a function
getTotalLength is not a function

While .getBBobx() is working fine.
Note: I am getting those error when locker service enabled

8
  • Check this out. Also, I suppose getTotalLength() has been deprecated.
    – SE_User
    Mar 15, 2017 at 8:13
  • what about other's?
    – ozil
    Mar 15, 2017 at 8:19
  • your answer's links are broken
    – ozil
    Mar 15, 2017 at 8:21
  • I'm still able to access it. Just try loading the same once again.
    – SE_User
    Mar 15, 2017 at 8:27
  • @ozil are you using above methods in init method? Mar 15, 2017 at 8:59

1 Answer 1

2

LockerService was missing a number of SVG elements and their associated methods/properties. This has been fixed in the Summer '17 major release.

Just make sure the methods are being called on the correct SVG types. getComputedTextLength, for example, should be called on SVGTextContentElement.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .