Skip to content

Impossible to set ListStyle.none to ChoicePrompt. #1370

@rodolZ80

Description

@rodolZ80

Versions

Botbuilder version 4.5.3
NodeJS version 10.16.3

Describe the bug

It is impossible to set ListStyle.none to ChoicePrompt.

To Reproduce

Steps to reproduce the behavior:

  1. Set a promptOptions with style as ListStyle.none
    const promptOptions: PromptOptions = { prompt: 'Say a letter' , choices: ['A', 'B'], style: ListStyle.none }
  2. Call to a prompt type ChoicePromt with this promptOptions
    return await stepContext.prompt('CHOICE_PROMPT', promptOptions);
  3. Options A and B are shown on the screen when they should not be shown.

Expected behavior

Show only the text 'Say a letter' in the screen. (client)

Additional context

The problem is in ChoicePrompt.ts
The style is set to ListStyle.auto by default
Line 67: this.style = ListStyle.auto;
In the onPrompt method if the options.style is false, null undefined or 0 , the assigned style will be the default one (ListStyle.auto).
Line 83: const choiceStyle: ListStyle = options.style || this.style;
The number none is assigned the value 0 .
File prompt.ts Line 17 :

export enum ListStyle {
    /**
     * Don't include any choices for prompt.
     */
    none,

`

[bug]

Metadata

Metadata

Assignees

Labels

Bot ServicesRequired for internal Azure reporting. Do not delete. Do not change color.customer-replied-toIndicates that the team has replied to the issue reported by the customer. Do not delete.customer-reportedIssue is created by anyone that is not a collaborator in the repository.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions