zenodo / zenodo-rdm

Zenodo, powered by InvenioRDM
https://zenodo.org/
GNU General Public License v2.0
36 stars 25 forks source link

subcommunities: projects search not always showing results #906

Closed slint closed 1 week ago

slint commented 1 week ago

To reproduce:

  1. Go to https://sandbox.zenodo.org/communities/eu/subcommunities/new
  2. Open the Dev tools "Network" tab and look at AJAX requests
  3. Search for fair-impact on the project search bar
  4. No results appear in the dropdown
  5. In the Network tab though, the response payload correctly contains the results for the project (it's the first result actually)
  6. You can actually verify that the results are in the dropdown, if you click outside it (to lose focus), and afterwards click inside of it. The results will then appear (since the dropdown re-renders I guess?)
image

This is probably some state issue with the React component not setting its state after the update.

On a side note, knowing that this component is similar to the one from the user/groups search in the Community members invitation and sharing modal, this buggy search behavior feels very similar. This means we might be able to fix this in general and improve users search as well.