Skip to content

Commit 0e76a69

Browse files
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>
1 parent 366f00e commit 0e76a69

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

core/src/components/accordion/accordion.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,7 @@ export class Accordion implements ComponentInterface {
514514

515515
'accordion-animated': this.shouldAnimate(),
516516
}}
517+
tabindex={disabled ? '-1' : undefined}
517518
>
518519
<div
519520
onClick={() => this.toggleExpanded()}

0 commit comments

Comments
 (0)