Description
Prerequisites
- I have read the Contributing Guidelines.
- I agree to follow the Code of Conduct.
- I have searched for existing issues that already report this problem, without success.
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
- Go to any card implementation that includes the button property
- Go to the shadow DOM
- Notice the button tags around the card
- Now go to https://www.w3.org/WAI/WCAG22/Understanding/info-and-relationships.html
- 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