Skip to content

Commit

Permalink
fix(components): use dynamic OptionCreator in OptionsList component
Browse files Browse the repository at this point in the history
feature/select-with-image
  • Loading branch information
samwx committed Nov 19, 2019
1 parent dd23b06 commit 533825c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/components/blipSelect/OptionsList.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export class OptionsList extends Component {
this.props = {
options: [],
canAddOptions: false,
OptionCreator: SelectOption,
}
}

Expand All @@ -32,10 +33,13 @@ export class OptionsList extends Component {
...props,
}

const { OptionCreator } = this.props

const renderOption = (option) =>
new SelectOption({
new OptionCreator({
onOptionClick: this.options.onOptionClick,
onTryAccessInput: this.options.onTryAccessInput,
descriptionPosition: this.props.descriptionPosition,
}).render(option)

return html`
Expand Down

0 comments on commit 533825c

Please sign in to comment.