IDEX493 change selected state when a tab has the focus

change selected state when a tab has the focus