Skip to content

Commit

Permalink
fix type-ahead doesn't generate correct JSON due to TA action element…
Browse files Browse the repository at this point in the history
… not being set
  • Loading branch information
Codeneos committed Aug 27, 2024
1 parent 05aac18 commit 53bdae1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/omniscript/src/omniScriptDefinitionBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export class OmniScriptDefinitionBuilder implements Iterable<OmniScriptElementDe
private scriptOffsets = new Map<string, number>();
private addElementHandlers: Partial<Record<OmniScriptElementType, OmniScriptDefinitionBuilder['addElement']>> = {
'Input Block': this.addInputBlock.bind(this),
'Selectable Items': this.addInputBlock.bind(this),
'Type Ahead Block': this.addTypeAheadBlock.bind(this)
};

Expand Down Expand Up @@ -431,7 +432,10 @@ class OmniScriptElementGroupDefinitionBuilder {
child.response = null;
child.children = [];

if (this.group.type === 'Type Ahead Block' && this.group.children.length) {
if (this.group.type === 'Type Ahead Block' &&
this.group.children.length &&
!this.group.children[0].eleArray[0].propSetMap?.taAction
) {
this.group.children[0].eleArray[0].propSetMap!.taAction = child;
} else {
this.group.children.push({
Expand Down

0 comments on commit 53bdae1

Please sign in to comment.