Fix right-most tabs randomly becoming invisible

Partially reverted from commit 6191a2b4cb10ffe1d8f372fdf2d42e10976d1a82
Merge pull request #3581 from ussuri/fix-tabs

Fix right-most tabs randomly becoming invisible