Skip to content

Commit

Permalink
Make SUI breadcrumb readable by screen readers (#14180)
Browse files Browse the repository at this point in the history
The breadcrumbs in the SUI were not readable by screen readers because they are represented as a button with a text block inside of it. Turns out, if you make the DataTemplate's item `IStringable` (meaning it has a `ToString()`), it all magically works! Allowing the screen reader to read the button as text.

Closes #13826

(cherry picked from commit 30046dd)
Service-Card-Id: 86158951
Service-Version: 1.15
  • Loading branch information
carlos-zamora authored and DHowett committed Oct 12, 2022
1 parent 78f1bdf commit c25cd5c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/cascadia/TerminalSettingsEditor/MainPage.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
_Label{ label },
_SubPage{ subPage } {}

hstring ToString() { return _Label; }

WINRT_PROPERTY(IInspectable, Tag);
WINRT_PROPERTY(winrt::hstring, Label);
WINRT_PROPERTY(BreadcrumbSubPage, SubPage);
Expand Down
2 changes: 1 addition & 1 deletion src/cascadia/TerminalSettingsEditor/MainPage.idl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace Microsoft.Terminal.Settings.Editor
Profile_Advanced
};

runtimeclass Breadcrumb
runtimeclass Breadcrumb : Windows.Foundation.IStringable
{
IInspectable Tag;
String Label;
Expand Down

0 comments on commit c25cd5c

Please sign in to comment.