Skip to content

Instantly share code, notes, and snippets.

@svierk
Created June 8, 2022 20:42
Show Gist options
  • Save svierk/e1f2ef4957c406bac3ec038e0c451ffe to your computer and use it in GitHub Desktop.
Save svierk/e1f2ef4957c406bac3ec038e0c451ffe to your computer and use it in GitHub Desktop.
Example of how to specify and access selectable as well currently selected option in LWC Combobox
export default class ParentComponent extends LightningElement {
options = [
{
label: 'Option 1',
value: 'option1'
},
{
label: 'Option 2',
value: 'option2'
},
{
label: 'Option 3',
value: 'option3'
}
];
selectedOptions = [];
handleChange(event) {
this.selectedOptions = event.detail;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment