Skip to content

Commit

Permalink
.NET Accessibility updates (microsoft#1696)
Browse files Browse the repository at this point in the history
* fix HTML date and showcard

* fixed aria-label attribute
  • Loading branch information
matthidinger authored and Gilles Khouzam committed Sep 20, 2018
1 parent bf3f838 commit 1c77111
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,13 @@ private void SetObjectTypes()

ActionTransformers.Register<AdaptiveOpenUrlAction>((action, tag, context) => tag.Attr("data-ac-url", action.Url));
ActionTransformers.Register<AdaptiveSubmitAction>((action, tag, context) => tag.Attr("data-ac-submitData", JsonConvert.SerializeObject(action.Data, Formatting.None)));
ActionTransformers.Register<AdaptiveShowCardAction>((action, tag, context) => tag.Attr("data-ac-showCardId", GenerateRandomId()));
ActionTransformers.Register<AdaptiveShowCardAction>((action, tag, context) =>
{
var showCardId = GenerateRandomId();
tag.Attr("data-ac-showCardId", showCardId);
tag.Attr("aria-controls", showCardId);
tag.Attr("aria-expanded", bool.FalseString);
});
}

protected static HtmlTag AddActionAttributes(AdaptiveAction action, HtmlTag tag, AdaptiveRenderContext context)
Expand Down Expand Up @@ -1238,7 +1244,8 @@ protected static HtmlTag DateInputRender(AdaptiveDateInput input, AdaptiveRender
.Attr("type", "date")
.AddClass("ac-input")
.AddClass("ac-dateInput")
.Style("width", "100%");
.Style("width", "100%")
.Attr("aria-label", (input.Placeholder ?? "Select date") + " in mm/dd/yyyy format");

if (!string.IsNullOrEmpty(input.Value))
{
Expand Down

0 comments on commit 1c77111

Please sign in to comment.