Skip to content

Commit

Permalink
Fixed array of strings options with custom label and value keys
Browse files Browse the repository at this point in the history
Fixed array of strings options when using custom value and label keys not rendering correctly.
Changed label and value keys to be set dynamically.
  • Loading branch information
sha-hin authored Oct 28, 2022
1 parent 8f1ff40 commit 76d42cb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/virtual-select.js
Original file line number Diff line number Diff line change
Expand Up @@ -1152,7 +1152,7 @@ export class VirtualSelect {
const prepareOption = (d) => {
if (typeof d !== 'object') {
// eslint-disable-next-line no-param-reassign
d = { value: d, label: d };
d = { [valueKey]: d, [labelKey]: d };
}

const value = secureText(getString(d[valueKey]));
Expand Down

0 comments on commit 76d42cb

Please sign in to comment.