You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Multiselect menu jumps to the top everytime an option is selected #3488
Hey I'm trying to create a multiselect in v2 and navigate through the options with my arrow keys. Everytime I select an option it jumps back to the top. It doesn't keep the state of the selected value. This is a feature that is in v1 but apparently isn't in v2?
Reacted by Jonathan Callewaert, Brecht Carnewal, Joachim Jonkers, brechttanghe, vicberger, Ward Loos, KevinDenys, Aliaksandr Kulitski, Pawel, Eric Bonow and 2 more
I can confirm that this does still happen in v3.1.0.
Having done some more research into when this happens (since it doesn't always seem to happen) I have noticed the following:
If controlShouldRenderValue={false} and you change the placeholder then it is guaranteed to jump. This seems to be because if the placeholder is re-rendered then the entire react component is re-rendered. Thus the jumping.
If values are supplied then the jumping happens as well.
Both of these were observed while using mobx. Then having done some more research. The problem seams to lie within mobx's or React's realm because of no having enough @computed fields. React seems to aggressively want to re-render items. I would suggest adding those annotations if you are using mobx.
Activity
KevinDenys commentedon Mar 28, 2019
I'm also having this issue is there a fix for this?
joachimjonkers commentedon Apr 1, 2019
same here! a fix would be much appreciated.
Nokel81 commentedon Sep 16, 2020
I can confirm that this does still happen in v3.1.0.
Having done some more research into when this happens (since it doesn't always seem to happen) I have noticed the following:
controlShouldRenderValue={false}and you change theplaceholderthen it is guaranteed to jump. This seems to be because if the placeholder is re-rendered then the entire react component is re-rendered. Thus the jumping.valuesare supplied then the jumping happens as well.Both of these were observed while using
mobx. Then having done some more research. The problem seams to lie withinmobx's orReact's realm because of no having enough@computedfields. React seems to aggressively want to re-render items. I would suggest adding those annotations if you are using mobx.