botframework-sdk icon indicating copy to clipboard operation
botframework-sdk copied to clipboard

Select choice from prompt by text input

Open carloscba opened this issue 9 years ago • 3 comments

System Information

  • SDK Platform: Node
  • SDK Version: 3.8
  • Development Environment: localhost

Issue Description

We found that many users don't click on button of Prompts.choice and writes the text of label. When users write with accents don´t work fine.

Example Code

bot.dialog('/', [
    function (session) {
        let options = {
            listStyle : builder.ListStyle['button'],
        };
        builder.Prompts.choice(session, '¿Qué quieres hacer? Presiona el botón de la opción que necesites.',
            [
                'Sí',
                'No',
                'Dónde'
            ], options);
    },
    function (session, results) {
        session.send('Option selected: '+ results.response.index)
    },
]);

Steps to Reproduce

  1. Run previous code
  2. Don't click option and write label of button without accent ("si" , "donde").

Expected Behavior

Continue flow with option selected

Actual Results

Don´t recognize option and retry prompt

carloscba avatar May 15 '17 22:05 carloscba

@carloscba I made a small update to your code it's working fine for me in the emulator.

bot.dialog('spanish_choice_prompt', [
    function (session) {
        let options = {
            listStyle : builder.ListStyle['button'],
        };
        builder.Prompts.choice(session, '¿Qué quieres hacer? Presiona el botón de la opción que necesites.',
            [
                'Sí',
                'No',
                'Dónde'
            ], options);
    },
    function (session, results) {
        session.send('Option selected: '+ results.response.entity);
        session.endDialog();
    }
]);

Here you can see it working correctly: screen shot 2017-05-15 at 4 43 33 pm screen shot 2017-05-15 at 4 43 10 pm screen shot 2017-05-15 at 4 42 46 pm

nwhitmont avatar May 15 '17 23:05 nwhitmont

@nwhitmont I am sorry for my mistake on description. The issue occurred when user write with accent.

"si" != "sí"

in this case don't work fine

image

carloscba avatar May 15 '17 23:05 carloscba

I found a little solution and close this issue.

Thank for your help @nwhitmont

carloscba avatar May 16 '17 02:05 carloscba