Fix tab order by creating widgets in correct order
(cherry picked from commit 96430cf80caf3f5fc7997e896d19863e66e7e0ad)