Flutter – TextField focus changes TabBar selected index

I have a Scaffold, within it I have a TabBar, TabBarView and a TextField.

The TabBar has 3 tabs (e.g. tabs A, B and C), the TabBarView has 3 views and this TextField is at the last tab (tab C).

Everything is working, but whenever I put the focus on the TextField to type something, the TabBar is changed from tab C to tab A. Very annoying. This should not happen. The TabBarView remains unchanged.

I create the controller in the initState. like this:

  @override   void initState() {     super.initState();     widget._tabBarController =         new TabController(length: 3, vsync: this);   } 

Any idea why it happens?