Handle tab events.