Skip to content

Issue with Prompts.choice: irrelevant string match if user provide choice as text instead of selecting it from the list of choices provided. #3115

@ncomo11

Description

@ncomo11

System Information (Required)

  • SDK Language: NodeJS
  • SDK Version: 3.8.3
  • Development Environment: Bot Service

Issue Description

While prompting user a list of choices it allow user to either select an option from the list or enter a text value. I know most convenient is to select from the given choices by tab or click on it but if user want to select same option by typing it manually then bot framework return wrong selected values.
See below example:
Screenshot from attached sample nodeJS application->
issue

It is weird but what I observed is that if there is any number in the text entered and it doesn't completely matches the provided choices it selects the option at that position. For example I entered cockpit 4 expecting it will match with 3rd option in the list but it actually returns 4th option.

I consider it as bug as its behavior is not documented and is not working as expected.

I have also created a sample/demo app to show case this issue and since above screenshot is from same app you can try out the example I have mentioned.

Download project from below link:
Demo app at github
Demo app at onedrive

Code Example

Demo app uploaded at above location

Steps to Reproduce the Issue

  1. type anything
  2. a list of choices will appear as in the screenshot at above link
  3. type "cockpit 4"

Expected Behavior

Expected bot return with the choice option matching string "cockpit 4"

Actual Results

Bot return the wrong choice and in fact it return the option at 4th position instead of matching the complete text entered i.e. "cockpit 4"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions