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

Can ComboBoxListItemPicker be used for cascading dropdowns? #683

Closed
gnowzstxela opened this issue Oct 7, 2020 · 2 comments
Closed

Can ComboBoxListItemPicker be used for cascading dropdowns? #683

gnowzstxela opened this issue Oct 7, 2020 · 2 comments
Labels
status:fixed-next-drop Issue will be fixed in upcoming release. type:bug
Milestone

Comments

@gnowzstxela
Copy link

Thank you for reporting an issue, suggesting an enhancement, or asking a question. We appreciate your feedback - to help the team understand your
needs please complete the below template to ensure we have the details to help. Thanks!

Please check out the documentation to see if your question is already addressed there. This will help us ensure our documentation is up to date.

Category

[X] Enhancement

[ ] Bug

[X] Question

Version

Please specify what version of the library you are using: [2.0.0 (latest) ]

If you are not using the latest release, please update and see if the issue is resolved before submitting an issue.

Expected / Desired Behavior / Question

The choices that ComboBoxListItemPicker displays seem to stick to the choices at the initial render. Subsequent changes to listId and filter do not seem to change the displayed choices. I understand that reloading the choices on listId and filter changes might be a heavy lift to implement. But it would sure be useful for doing cascading dropdowns. Or perhaps some function or hook that would allow one to explicitly call a reload/refresh for the ComboBoxListItemPicker. Then one could call such a function in the onSelection/onSelected function of the control(s) that determine the choices for the ComboBoxListItemPicker.

Observed Behavior

ListItemPicker responds properly to dynamic changes to listId and filter after the initial render. But ComboBoxListItemPicker does not. ComboBoxListItemPicker seems to stick with the initial settings of listId and filter at the time of the initial render, instead of using new values of these two parameters to reload the available choices. This means I can't use ComboBoxListItemPicker for cascading dropdowns

Steps to Reproduce

  1. Setup Cascading List and ListItem example from:

https://ravichandran.blog/2020/05/08/cascading-list-and-listitem-using-pnp-controls-in-the-sharepoint-framework-spfx-webpart/

It works fine, as expected. The ListItemPicker responds dynamically to changes in listId after the initial render.

  1. Changed the ListItemPicker control to ComboBoxListItemPicker as follows:

     <ComboBoxListItemPicker  
       listId={this.state.SeletedList}
       columnInternalName='Title'
       keyColumnInternalName='Id'
       //itemLimit={1}
       onSelectedItem={this.onSelectedItem}
       //context={this.props.context} 
       webUrl={this.props.context.pageContext.web.absoluteUrl}
       spHttpClient={this.props.context.spHttpClient} />            
    

When run, the choices shown by ComboBoxListItemPicker remain stuck on whatever the initial value of this.state.SeletedList was, even after the value changes.

@ghost
Copy link

ghost commented Oct 7, 2020

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

@ghost ghost added the Needs: Triage 🔍 label Oct 7, 2020
AJIXuMuK added a commit that referenced this issue Oct 18, 2020
@AJIXuMuK
Copy link
Collaborator

Hi @gnowzstxela.
Thank you for reporting this one!
Fix has been done and will be available in the next release.
In a meanwhile you can test the functionality in the beta version

@AJIXuMuK AJIXuMuK added status:fixed-next-drop Issue will be fixed in upcoming release. type:bug and removed Needs: Triage 🔍 labels Oct 18, 2020
@AJIXuMuK AJIXuMuK added this to the 2.1.0 milestone Oct 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:fixed-next-drop Issue will be fixed in upcoming release. type:bug
Projects
None yet
Development

No branches or pull requests

2 participants