I'm surprised that you can even input a TAB at all, given that most browsers I use will take that as meaning "move to the next input field in the TAB-ordering"
Possible workaround: pre-filtering input with s/\t/ /g
seems like the right thing. I can't imagine anyone expecting TAB to actually do anything else in this context (especially since whatever it might be won't work in regular browsers anyway).