Skip to content

Commit

Permalink
Fixed vocab component title and value population from an event.
Browse files Browse the repository at this point in the history
  • Loading branch information
shilob committed Nov 26, 2024
1 parent b87e717 commit b762cd9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion angular-legacy/shared/form/field-vocab.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -898,7 +898,7 @@ export class VocabFieldComponent extends SimpleComponent {
this.field.setValue(this.field.getValue(selected.title), emitEvent, updateTitle);
} else if (this.field.storeFreeTextAsString && (_.isString(selected['originalObject']) || _.keys(selected['originalObject']).length == 1) ) {
// the above condition is true when the field is storing freely entered text
const title = selected.title || selected['originalObject'];
const title = selected.title || (_.get(selected['originalObject'], 'title') || selected['originalObject']);
this.field.setValue(this.field.getValue(title), emitEvent, updateTitle);
} else {
this.field.setValue(this.field.getValue(selected['originalObject']), emitEvent, updateTitle);
Expand Down

0 comments on commit b762cd9

Please sign in to comment.