Skip to content

bug: WCAG 2.2 guideline 1.3.1 failed: button property in card makes cards not comply with WCAG #30407

Closed as not planned
@ijsje71

Description

@ijsje71

Prerequisites

Ionic Framework Version

v8.x

Current Behavior

When the button property is added to a card, the card styling is rendered in tags. This violates WCAG guideline 1.3.1 and is hard for a screenreader to comprehend, as there is a lot of styling within those cards. A button normally does not have titles, subtitles etc. inside, which is functionality that is available for cards.

When the button is removed, the card is still clickable, but screen readers then do not know that this is a clickable item.

Expected Behavior

When the card is tappable, it is rendered through links or another interactive component. This should not violate WCAG guidelines.

We currently have a workaround that uses href="javascript:void(0)" to invoke the onclick method for screen readers as well, but I would prefer to see an out-of-the-box solution to tappable buttons that is WCAG compliant.

Steps to Reproduce

  1. Go to any card implementation that includes the button property
  2. Go to the shadow DOM
  3. Notice the button tags around the card
  4. Now go to https://www.w3.org/WAI/WCAG22/Understanding/info-and-relationships.html
  5. Notice the difference between the guidelines and the button tag in the card implementation

Code Reproduction URL

I could make a git repo from this, but seems a bit overkill for just a card...

Ionic Info

Ionic:

Ionic CLI : 7.2.0
Ionic Framework : @ionic/react 8.5.7

Capacitor:

Capacitor CLI : 7.2.0
@capacitor/android : not installed
@capacitor/core : 7.2.0
@capacitor/ios : not installed

Utility:

cordova-res : not installed globally
native-run : 2.0.1

System:

NodeJS : v22.14.0
npm : 10.9.2
OS : macOS Unknown

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs: replythe issue needs a response from the user

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions