Update the tab caption widths when necessary (#13402)

Change-Id: I9c319625da3e4cfc5b49c339f54393f7e12effed