Skip to main content
edited tags
Link
pchittum
  • 19.8k
  • 5
  • 57
  • 99
Source Link
Bob Buzzard
  • 20k
  • 1
  • 47
  • 81

Summer 16 Canvas Error with Lightning Locker Service Enabled

I have a lightning component on the app exchange that provides a canvas element for the user to draw their signature. In a Summer 16 pre-release org with the lightning locker service enabled, when I attempt to get the drawing context via :

this.ctx = this.canvas.getContext('2d');

I get the following error:

    TypeError: this.canvas.getContext is not a function. (In 
      'this.canvas.getContext("2d")', 'this.canvas.getContext' is undefined)