I have gone through the code on the above link. But I can't seem to understand Line 495 where its written this.canvas.wrapperEl as it is not defined anywhere.
Asked
Active
Viewed 376 times
1 Answers
1
This is a reference to the wrapper div
element that fabric.js wraps around the actual canvas it draws on. This property is intended for internal use, that's why there is no mention of it in the docs.
If you inspect the HTML on a page that uses a fabric.js canvas in it, you'll see something like this:
<div class="canvas-container" style="...">
<canvas id="c" width="1000" height="800" class="lower-canvas" style="..."></canvas>
<canvas class="upper-canvas" width="500" height="400" style="..."></canvas>
</div>
The canvas-container
div is your wrapperEl
.

shkaper
- 4,689
- 1
- 22
- 35
-
Is 'wrapperEl' a keyword which is universal in HTML DOM or just specific to FabricJS? – PRS Feb 20 '20 at 08:08
-
@PRS it's specific to fabric.js – shkaper Feb 20 '20 at 12:54