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 '17 at 8:13
  • what about other's?
    – ozil
    Mar 15 '17 at 8:19
  • your answer's links are broken
    – ozil
    Mar 15 '17 at 8:21
  • I'm still able to access it. Just try loading the same once again.
    – SE_User
    Mar 15 '17 at 8:27
  • @ozil are you using above methods in init method? Mar 15 '17 at 8:59
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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.