Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should Input.Number value accept a string? #3287

Closed
v-kydela opened this issue Jul 31, 2019 · 8 comments
Closed

Should Input.Number value accept a string? #3287

v-kydela opened this issue Jul 31, 2019 · 8 comments
Labels
Area-Inconsistency Bugs around renderer inconsistencies across different platforms Bug

Comments

@v-kydela
Copy link

Issue

Every version of the schema I've seen says the value property of Input.Number only accepts a number.

image

However, I've tried using a string for the value in both Web Chat and Microsoft Teams and they work. Both of these inputs render the same:

{
  "type": "Input.Number",
  "id": "id-number",
  "value": 7,
  "placeholder": "Placeholder text"
},
{
  "type": "Input.Number",
  "id": "id-numberString",
  "value": "7",
  "placeholder": "Placeholder text"
},

Which is correct? Should the schema say "number, string" instead of just number? Or are those renderers operating contrary to the schema?

@matthidinger matthidinger added the Area-Inconsistency Bugs around renderer inconsistencies across different platforms label Aug 5, 2019
@corinagum
Copy link
Contributor

+1, though behavior has changed slightly. On Web Chat, we have used "value": 1 in the past, which would show the default value as 1. However when bumping to 1.23 recently there was a change where the 1 is no longer inserted as a value, so the input is blank. "value": "1" does work, however.

{
  "$schema": "https://microsoft.github.io/AdaptiveCards/schemas/adaptive-card.json",
  "type": "AdaptiveCard",
  "version": "1.2",
  "body": [
    {
      "type": "Input.Number",
      "placeholder": "Quantity",
      "min": -5,
      "max": 5,
      "value": 1,
      "id": "NumVal",
      "speak": "How many do you want?"
    }
  ]
}

The above code shows an empty input in the visualizer.

Particularly in contrast with the min and max properties, this seems like an odd inconsistency.

For now Web Chat is using the workaround. :)

@v-kydela
Copy link
Author

When considering that all Adaptive Card inputs send their submitted values to the bot as strings, it might make the most sense for Input.Number to only accept a string value, like the other inputs. It seems like this new behavior reflects that idea.

@ghost
Copy link

ghost commented Nov 29, 2019

This issue has been automatically marked as stale because it has not had any activity for 5 days.

@ghost ghost added the no-recent-activity label Nov 29, 2019
@v-kydela
Copy link
Author

@matthidinger - Can you comment?

@shalinijoshi19
Copy link
Member

@dclaux / @matthidinger this is what's causing fresh inconsistency issues around Input.Number processing across renderers. Related to issue microsoft/BotFramework-Services/#185

@ghost ghost added the Triage-Needed label Jul 27, 2020
@RebeccaAnne RebeccaAnne added this to the Backlog milestone Jul 27, 2020
@ghost ghost removed the Triage-Needed label Jul 31, 2020
@ghost
Copy link

ghost commented Jul 31, 2020

Hi @v-kydela. We have acknowledged this issue report. Please continue to follow this issue for updates/progress/questions.

@shalinijoshi19
Copy link
Member

shalinijoshi19 commented Nov 30, 2020

Tracking with #5111 , #3829

@ghost
Copy link

ghost commented Dec 4, 2020

Thanks for looking into this stale issue shalinijoshi19; Resetting staleness. @v-kydela FYI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Inconsistency Bugs around renderer inconsistencies across different platforms Bug
Projects
None yet
Development

No branches or pull requests

5 participants