Change TextInput to inherit from FocusBehavior.

This is a rebase from #2149 to fix the merge conflicts.