Created
June 8, 2022 20:42
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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