Skip to content

Commit 53bdae1

Browse files
committed
fix type-ahead doesn't generate correct JSON due to TA action element not being set
1 parent 05aac18 commit 53bdae1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/omniscript/src/omniScriptDefinitionBuilder.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export class OmniScriptDefinitionBuilder implements Iterable<OmniScriptElementDe
2727
private scriptOffsets = new Map<string, number>();
2828
private addElementHandlers: Partial<Record<OmniScriptElementType, OmniScriptDefinitionBuilder['addElement']>> = {
2929
'Input Block': this.addInputBlock.bind(this),
30+
'Selectable Items': this.addInputBlock.bind(this),
3031
'Type Ahead Block': this.addTypeAheadBlock.bind(this)
3132
};
3233

@@ -431,7 +432,10 @@ class OmniScriptElementGroupDefinitionBuilder {
431432
child.response = null;
432433
child.children = [];
433434

434-
if (this.group.type === 'Type Ahead Block' && this.group.children.length) {
435+
if (this.group.type === 'Type Ahead Block' &&
436+
this.group.children.length &&
437+
!this.group.children[0].eleArray[0].propSetMap?.taAction
438+
) {
435439
this.group.children[0].eleArray[0].propSetMap!.taAction = child;
436440
} else {
437441
this.group.children.push({

0 commit comments

Comments
 (0)