refactor search logic
focus the right tab after splicing