Insert Chars Bug

FabricJS

by Eugene Vilder

HTML

<script src="http://fabricjs.com/lib/fabric.js"></script>
<canvas id="paper" width="400" height="400" style="border:1px solid #ccc"></canvas>

JavaScript

var canvas = new fabric.Canvas('paper');
canvas.setHeight(300);
canvas.setWidth(500);

var text = new fabric.Textbox('Heo world', {
  left: 50,
  top: 10,
  fontFamily: 'arial',
  fill: '#333',
  fontSize: 50
});

canvas.add(text);

const style = {
	textBackgroundColor: 'red'
};

const chars = "ll", selectionStart = 2;

//Need help with the function, since it doesn't exists anymore
text.insertChars(chars, selectionStart, style);
//////////////////////////////////////////////////////////////

canvas.renderAll();