AdaptiveCards
AdaptiveCards copied to clipboard
HTML renderer doesn't set default value of date input
Input.Date schema has a value property to set the default value, but this is not implemented in the HTML renderer.
This was my temporary fix:
AdaptiveCards.DateInput.prototype.internalRender = (() => {
let original = AdaptiveCards.DateInput.prototype.internalRender;
return function() {
var element = original.call(this);
if (this.defaultValue) {
element.value = this.defaultValue;
}
return element;
};
})();
html date inputs seem to accept values of the form 'YYYY-MM-DD' as strings, so as long as the value is of that format, it works.
https://github.com/Microsoft/AdaptiveCards/pull/343
Can't repro, I must have fixed this a while back.