Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiselect widget loses selected values #1042

Closed
resposit opened this issue Feb 2, 2020 · 5 comments
Closed

Multiselect widget loses selected values #1042

resposit opened this issue Feb 2, 2020 · 5 comments
Assignees
Labels
bug

Comments

@resposit
Copy link

@resposit resposit commented Feb 2, 2020

Summary

It seems there's a situation where a multiselect widget loses its selected values.

Steps to reproduce

Consider the following app:

ab = ['a','b']
cb = st.checkbox('cb',value=True,key='cb')
if not cb:
    ms1 = st.multiselect('ms1',ab,default=ab,key='ms1')
ms2 = st.multiselect('ms2',ab,default=ab,key='ms2')
  1. Click on 'b' in ms2 (this will select only 'a')
  2. Click on the checkbox (this will display ms1 before ms2)

Expected behavior:

I would expect ms2 displaying only 'a' as preselected value.

Actual behavior:

ms2 displays 'a' and 'b' as it was rendered for the first time

Is this a regression?

don't know

Debug info

  • Streamlit version: 0.54.0
  • Python version: 3.6.8
@resposit resposit added the bug label Feb 2, 2020
@resposit

This comment has been minimized.

Copy link
Author

@resposit resposit commented Feb 2, 2020

Apparently, if I use a placeholder for ms1 I get the expectect behavior:

cb = st.checkbox('cb',value=True,key='cb')
eb = st.empty()
if not cb:
    ms1 = eb.multiselect('ms1',ab,default=ab,key='ms1')
ms2 = st.multiselect('ms2',ab,default=ab,key='ms2')

I don't quite understand the difference...

@arraydude

This comment has been minimized.

Copy link
Contributor

@arraydude arraydude commented Feb 11, 2020

Hello @resposit , Thanks for catching this! , this is an actual bug and we are going to be fixing this as soon as possible.

@arraydude arraydude self-assigned this Feb 11, 2020
@jrhone

This comment has been minimized.

Copy link
Contributor

@jrhone jrhone commented Feb 12, 2020

Related to #1080

@resposit

This comment has been minimized.

Copy link
Author

@resposit resposit commented Feb 26, 2020

Hi @arraydude
I'm still getting the same behavior with streamlit version 0.56.0.

@arraydude

This comment has been minimized.

Copy link
Contributor

@arraydude arraydude commented Mar 23, 2020

@resposit This will be available in the next release ( 0.57.0 )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

3 participants
You can’t perform that action at this time.