amphtml icon indicating copy to clipboard operation
amphtml copied to clipboard

amp-story-page-attachment - Empty CTA means accessibility issue

Open Pateriack opened this issue 3 years ago • 1 comments

Description

Unsure if this should be considered a bug report or feature request as this is a slightly weird use case.

I've been passing in a string with just a space " " to the CTA for the amp-story-page-attachment, in order to prevent the default CTA text from rendering.

The styling and customizability of the CTA is not sufficient for our use case, so we have inserted our own elements right under the button so we can have more control: image

This means that we get the following accessibility violation reported by accessibility checkers: image

I can see 2 possibly solutions for amp:

  1. Allow an empty CTA but always add a hidden bit of text that says something like "Swipe-up"
  2. Allow us to pass in our own content for the swipe-up CTA somehow.

1 would be preferable with no change required from my end.

Alternatives Considered

I've given 2 suggested solutions in the description

Additional Context

No response

Pateriack avatar Jul 26 '23 15:07 Pateriack

I don't think we want to allow an empty CTA string just to rely on developers to customize CTA string in their own styles. The whole point of having a shadow root to host CTA component is for UX consistency for all stories that provide a swipe-up inline page attachment experience. I would recommend to simplify your CTA string design instead in this case.

And the follow-up todo on our end is actually to provide default CTA if we found the CTA string provided is empty.

ychsieh avatar Aug 01 '23 09:08 ychsieh