Skip to content

Commit

Permalink
fix(forms): incorrect value set with vaadin-combo-box when using item…
Browse files Browse the repository at this point in the history
…ValuePath
  • Loading branch information
asyncLiz committed Aug 29, 2018
1 parent d126c46 commit 4f738a7
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions forms/src/value-accessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ export class OrigamiControlValueAccessor extends DefaultValueAccessor
!!element &&
element.multi === true &&
(this.isPropertyDefined(element, 'selectedValues') ||
this.isPropertyDefined(element, 'selectedValues'))
this.isPropertyDefined(element, 'selectedItems'))
);
}

Expand Down Expand Up @@ -455,6 +455,13 @@ export class OrigamiControlValueAccessor extends DefaultValueAccessor
}
}

return this.useSelectableValueProp ? valueProp : indexProp;
if (element.itemValuePath) {
// <vaadin-combo-box> will want to use selectedItem for object values.
// However, if `itemValuePath` is set then the control value is not the
// item itself, but the `value` property.
return 'value';
} else {
return this.useSelectableValueProp ? valueProp : indexProp;
}
}
}

0 comments on commit 4f738a7

Please sign in to comment.