Fixed issue when middle-clicking open a new tab

Fixed issues which caused the wrong dropdown to appear after having
middle-clicked open a new tab as I did not check if the change to a tab
was the currently select tab.