ui-components icon indicating copy to clipboard operation
ui-components copied to clipboard

Investigate to make a button work as a link

Open twjeffery opened this issue 1 year ago • 2 comments

Generally, Links are for navigating and buttons are for performing actions.

When we have a tertiary button that is a link, do we need a role=link? Or should that not use a button at all, and always use a link? #1809: text-link component

Acceptance Criteria:

Accessibility spike to determine if button needs role=link or if a text link component should always be used instead of a button when it's a link to somewhere.

@vanessatran-ddi please add more information

twjeffery avatar Apr 29 '24 21:04 twjeffery

To add the context, this is the comment: back link comment

So we change the goa-button type="tertiary" to a text link because:

  • The button handles router to navigate to a specified href (previous page), so it is highly recommended to be a link (for a screen reader to announce, for accessibility)
  • The button always has this error: "That way it doesn't go full width on mobile. "

Sometimes we want to use a goa-button represents a link because: image

We want to make use of goa-button-group for the alignment.

The idea is: We can render the button if goa-button href="something" to be a link like this:

image

So it has a look of our goa-button but in fact it is an a element. In that case, we don't make a goa-button width to be full screen.

vanessatran-ddi avatar Apr 29 '24 21:04 vanessatran-ddi

@Spark450 @twjeffery Investigate accessibility issues behind doing this

ArakTaiRoth avatar May 09 '24 21:05 ArakTaiRoth