You can do a couple of things to make it more performative:

  • Lazy load the amount of users ( i.e. pull them in batches of maybe 50) and add a button or keep track of the scroll position on the dropdown to load more users. When the button is clicked or the scroll position of the dropdown is at the end, append the next 50 users to the dropdowns options.
  • If your search is not already searching for users not in the current team, update it to have that constraint ( i.e. Do a search for users where user is not in current team).