Skip to content

Commit

Permalink
[PORT]update adaptive inputs to set inputHint = expectingInput (#2022)
Browse files Browse the repository at this point in the history
  • Loading branch information
Danieladu authored Apr 14, 2020
1 parent 4f6e925 commit 543fdb0
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions libraries/botbuilder-dialogs-adaptive/src/input/inputDialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,24 +199,30 @@ export abstract class InputDialog extends Dialog {
}

protected async onRenderPrompt(dc: DialogContext, state: InputState): Promise<Partial<Activity>> {
let msg: Partial<Activity>;
switch (state) {
case InputState.unrecognized:
if (this.unrecognizedPrompt) {
return await this.unrecognizedPrompt.bindToData(dc.context, dc.state);
msg = await this.unrecognizedPrompt.bindToData(dc.context, dc.state);
} else if (this.invalidPrompt) {
return await this.invalidPrompt.bindToData(dc.context, dc.state);
msg = await this.invalidPrompt.bindToData(dc.context, dc.state);
}
break;
case InputState.invalid:
if (this.invalidPrompt) {
return await this.invalidPrompt.bindToData(dc.context, dc.state);
msg = await this.invalidPrompt.bindToData(dc.context, dc.state);
} else if (this.unrecognizedPrompt) {
return await this.unrecognizedPrompt.bindToData(dc.context, dc.state);
msg = await this.unrecognizedPrompt.bindToData(dc.context, dc.state);
}
break;
}

return await this.prompt.bindToData(dc.context, dc.state);
if (!msg) {
msg = await this.prompt.bindToData(dc.context, dc.state);
}

msg.inputHint = InputHints.ExpectingInput;
return msg;
}

protected getDefaultInput(dc: DialogContext): any {
Expand Down

0 comments on commit 543fdb0

Please sign in to comment.