fix(checkbox): add aria attributes to ignore checkbox icon (#30633)

Issue number: resolves #30231

---------

<!-- Please do not submit updates to dependencies unless it fixes an
issue. -->

<!-- Please try to limit your pull request to one type (bugfix, feature,
etc). Submit multiple pull requests if needed. -->

## What is the current behavior?
<!-- Please describe the current behavior that you are modifying. -->

Currently, if you're using voiceover on Chrome or Firefox, you can
navigate the checkbox in such a way that it announces the checkbox
image, which provides no context to what you're actually selecting.

## What is the new behavior?
<!-- Please describe the behavior or changes that are being added by
this PR. -->

With this change, you can no longer select the checkbox image.

## Does this introduce a breaking change?

- [ ] Yes
- [X] No

<!--
  If this introduces a breaking change:
1. Describe the impact and migration path for existing applications
below.
  2. Update the BREAKING.md file with the breaking change.
3. Add "BREAKING CHANGE: [...]" to the commit description when merging.
See
https://github.com/ionic-team/ionic-framework/blob/main/docs/CONTRIBUTING.md#footer
for more information.
-->


## Other information

<!-- Any other information that is important to this PR such as
screenshots of how the component looks before and after the change. -->


[Screen](https://ionic-framework-git-ionic-56-ionic1.vercel.app/src/components/checkbox/test/basic)

---------

Co-authored-by: Brandy Smith <brandyscarney@users.noreply.github.com>
This commit is contained in:
Shane
2025-08-18 07:15:20 -07:00
committed by GitHub
parent ed13318209
commit e9e6605862

View File

@ -328,7 +328,7 @@ export class Checkbox implements ComponentInterface {
{this.renderHintText()}
</div>
<div class="native-wrapper">
<svg class="checkbox-icon" viewBox="0 0 24 24" part="container">
<svg class="checkbox-icon" viewBox="0 0 24 24" part="container" aria-hidden="true">
{path}
</svg>
</div>