fix(accordion): update tabindex based on disabled state (#30986)

Issue number: resolves internal

---------

## What is the current behavior?
When an accordion item was set as disabled, it was still possible to
focus using keyboard navigation.

## What is the new behavior?
When an accordion item is disabled, `tabindex` is set as -1 to stop
being focusable using the keyboard navigation.

## Does this introduce a breaking change?

- [ ] Yes
- [ ] No

## Other information


[preview](https://ionic-framework-qznd9tqne-ionic1.vercel.app/src/components/accordion-group/test/states/)

---------

Co-authored-by: Maria Hutt <maria.hutt@outsystems.com>
This commit is contained in:
David Lourenço
2026-03-05 18:45:32 +00:00
committed by GitHub
parent 366f00e25f
commit 0e76a69370

View File

@@ -514,6 +514,7 @@ export class Accordion implements ComponentInterface {
'accordion-animated': this.shouldAnimate(),
}}
tabindex={disabled ? '-1' : undefined}
>
<div
onClick={() => this.toggleExpanded()}