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

PropertyPaneMultiSelect is not retaining preselected values #85

Closed
harshdamaniahd opened this issue Aug 1, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@harshdamaniahd
Copy link

commented Aug 1, 2018

The problem is the once i set the values and then save the changes, the next time when i open the webpart configuration the multiselect values are not retained.


                PropertyFieldMultiSelect('selectedColumns', {
                  key: 'selectedColumns',
                  label: "Multi select field",
                  options: this.ddlColumnOptions,
                  selectedKeys: this.properties.selectedColumns
                })

Here is the screen shot , the value for normal dropdown are retained.But it is not working for multiselect

image

Code on start :


  protected async onPropertyPaneConfigurationStart(): Promise<any> {
    debugger;
    let lists:IPropertyPaneDropdownOption[]=await this.getAllList();
    this.ddlListOptions=lists;
    this.render();
    this.context.propertyPane.refresh();
    let views:IPropertyPaneDropdownOption[]=await this.getAllViews()
    this.ddlViewOptions=views;
    this.render();
    this.context.propertyPane.refresh();
    let columns:IPropertyPaneDropdownOption[]=await this.loadColumns();
    this.ddlColumnOptions=columns;
    this.render();
    this.context.propertyPane.refresh();
  }

@harshdamaniahd harshdamaniahd changed the title PropertyPaneMultiSelect PropertyPaneMultiSelect is not retaining preselected values Aug 1, 2018

@estruyf

This comment has been minimized.

Copy link
Collaborator

commented Aug 9, 2018

This is an issue in the Office UI Fabric control used behind the scenes which seems to have issues when async options are provided. I did an update to the control so that it is supported.

Here you can see the result:
multiselect-async

estruyf added a commit that referenced this issue Aug 9, 2018

@estruyf estruyf added this to the 1.9.0 milestone Aug 9, 2018

estruyf added a commit that referenced this issue Aug 9, 2018

@estruyf estruyf closed this Aug 9, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.