ListBox to remember selection after data re-query

A change to the Table component a while back made a huge difference - the selected row stays the same after the underlying data is re-queried.

I would like the same thing for the ListBox. Now to be fair it does this, but only if you have the Default value empty. But I would like the first item in the list to be selected on page load and have the selection remembered when re-querying.

I sometimes use it as a lightweight alternative to the Table component for the parent side of a parent/child view.

Hi @bradlymathews! Are you able to use temporaryState in this case to "remember" your last selection?

I could do that, or add a function on page load to wait for the query to finish and then make the initial selection programmatically, but that's all extra wiring to maintain. So looking at the cost/benefit analysis, I'll just live with no selection on initial page load for now.

Understood! Thanks for sharing the additional info on your use case. I'll continue to keep you updated when this is ready. :slightly_smiling_face: