We’ve now completed our implementation for drawing simple objects in FabricJS, using our TypeScript models. Let’s now work on how to remove objects from the canvas.

To implement deletion of the selected object in our drawing canvas, we needed to:

  • Create a new abstract base component for a toolbar control.
  • Implement the abstract base component to create a Delete component.
  • Wire up the delete component to the DrawingEditor.
  • Listen for the Delete key, and delete selected objects.

Don’t forget to check out the sample project over on GitHub!

#fabricjs #typescript

Drawing with FabricJS and TypeScript: Deleting Objects
10.45 GEEK