Botframework-webchat: Input.Date fields ignore preset values

Created on 25 Jul 2019  路  4Comments  路  Source: microsoft/BotFramework-WebChat

Screenshots

Expected:

image

Actual:

image

Version

<script src="https://cdn.botframework.com/botframework-webchat/latest/webchat.js"></script>

Describe the bug

Input.Date fields in Adaptive Cards have a value property that is supposed to specify the input's initial value. While the property works in Microsoft Teams, it seems to be ignored in Web Chat.

To Reproduce

{
  "type": "AdaptiveCard",
  "body": [
    {
      "type": "Input.Date",
      "id": "id-date12",
      "value": "12/13/14"
    }
  ],
  "actions": [
    {
      "type": "Action.Submit",
      "title": "Submit"
    }
  ],
  "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
  "version": "1.0"
}

Additional Context

The value properties of other input fields seem to work correctly.

[Bug]

Bug

All 4 comments

image
It looks like it's not respected on Adaptive Cards either.

I think this is related to https://github.com/microsoft/BotFramework-WebChat/issues/2192

~I would file this with Adaptive Cards.~ Nevermind, please see below.

After some further investigation, I have discovered that the value property does work if you provide the date in the format yyyy-mm-dd. It does not work in the format mm/dd/yy, though that seems to be a Web Chat specific problem.

I have also discovered another bug while testing this. The placeholder property does not work in Input.Date though it does work in Input.Text. The placeholder property works for both input types in Microsoft Teams. The placeholder property was introduced in Adaptive Cards 1.0 so this can't be a version issue.

This is HTML issue.

  1. If the value attribute is not in the format of yyyy-mm-dd, Chrome/Edge will not be able to parse it. Not Adaptive Cards or Web Chat issue. You can try it out at https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/date.
  2. According to HTML Living Standard for date input, placeholder attribute is not supported. Excerpt below:

image

Looks like @corinagum opened an issue for the date input placeholder issue in the Adaptive Cards repo already https://github.com/microsoft/AdaptiveCards/issues/2255

Was this page helpful?
0 / 5 - 0 ratings

Related issues

felixhauserch picture felixhauserch  路  3Comments

adriantan08 picture adriantan08  路  3Comments

corinagum picture corinagum  路  3Comments

marcasmar94 picture marcasmar94  路  3Comments

prashanthsridhar picture prashanthsridhar  路  3Comments