Do you want to add a text input field into the canvas or do you want to add text inputted by user via some means of input, e.g. by an HTML Input Element, not necessarily inside a canvas element?
Just asking?
You can actually use an html input element positioned onto a canvas element by using css absolute positioning. Link
Also have look at that utility here: Link
Note: I have not verified if the solutions are working. But the ideas looks fine.