router icon indicating copy to clipboard operation
router copied to clipboard

Screen Reader Support

Open aress31 opened this issue 5 years ago • 2 comments

Using the static method go on an onClick event handler, is it possible to display the links for screen readers?

For example let's take the following code:

 <div>
        <h3>Foo</h3>
        <mwc-list>
          <mwc-list-item
            @click=${() => Router.go('/foo/foo')}
            >Foo</mwc-list-item
          >
          <mwc-list-item
            @click=${() =>
              Router.go('/foo/foo')}
            >Foo</mwc-list-item
          >
        </mwc-list>
      </div>

For screen reader supports I would like to have the links displayed in the bottom left corner of my browser, is it something possible?

aress31 avatar Sep 13 '20 12:09 aress31

Hi @aress31 to have better accessibility support, it's better to use the <a> element instead. I found an example of wrapping <mvc-list-item> into an <a>.

<mwc-list>
  <a href="google.com"><mwc-list-item>google</mwc-list-item></a>
  <a href="bing.com"><mwc-list-item>bing</mwc-list-item></a>
  <a href="duckduckgo.com"><mwc-list-item>duck duck go</mwc-list-item></a>
</mwc-list>

Would this work for you?

haijian-vaadin avatar Sep 15 '20 06:09 haijian-vaadin

Hi @haijian-vaadin, this indeed works, but I want to do client side routing with the Vaadin router, the point was to add screen reader when routing with Vaadin router in a similar fashion than the React router does.

aress31 avatar Sep 15 '20 11:09 aress31