In fabricjs, I want to create a scene in which the object under the mouse rises to the top of the scene in z-index, then once the mouse leaves that object, it goes back to the z
Since fabric.js version 1.1.4 a new method for zIndex manipulation is available:
canvas.moveTo(object, index); object.moveTo(index);
I think this is helpful for your use case. I've updated your jsfiddle - i hope this is what you want: jsfiddle