Skip to content

useComboBox does network request on selection change #2493

Answered by LFDanLu
isshesure asked this question in Q&A
Discussion options

You must be logged in to vote

IMO this is expected behavior so that the ComboBox can get the list of results that matches the newly selected text. For example, a slightly contrived example:

  1. You have a list of names in a database in which there exists "Bob", "Bob Jr", and "Bob Sr".
  2. The user types "B" in the ComboBox, sees "Bob" and selects it
  3. The text in the ComboBox updates, prompting a network request that fetches all names w/ "Bob" as a substring
  4. If the user opens the ComboBox manually, they will see a properly filtered list of names. Without the network request in step 3 being fired from the option selection in step 2, that list would be unfiltered and you would see all names that contain "B"

If you really need t…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@isshesure
Comment options

Answer selected by isshesure
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants