Prerequisites
Ionic Framework Version
v7.x
Current Behavior
If you have an ion-accordion with readonly="true", tab to it, and press Enter, the accordion will open. This does not occur if readonly is set on the parent ion-accordion-group.
Expected Behavior
Readonly accordions should not be interactable, even with keyboard controls.
Steps to Reproduce
- Navigate to https://ionicframework.com/docs/api/accordion#individual-accordion-1
- Use the Tab key to focus the second accordion
- Press Enter; the accordion will open
Code Reproduction URL
https://ionicframework.com/docs/api/accordion#individual-accordion-1
Ionic Info
N/A (reproducible from v7 docs)
Additional Information
ion-accordion-group doesn't exhibit this behavior because of this piece:
|
if (readonly || disabled) { |
|
return; |
|
} |
Fixing this in ion-accordion should hopefully be as simple as returning early if readonly is set here:
|
private toggleExpanded() { |
Prerequisites
Ionic Framework Version
v7.x
Current Behavior
If you have an
ion-accordionwithreadonly="true", tab to it, and press Enter, the accordion will open. This does not occur ifreadonlyis set on the parention-accordion-group.Expected Behavior
Readonly accordions should not be interactable, even with keyboard controls.
Steps to Reproduce
Code Reproduction URL
https://ionicframework.com/docs/api/accordion#individual-accordion-1
Ionic Info
N/A (reproducible from v7 docs)
Additional Information
ion-accordion-groupdoesn't exhibit this behavior because of this piece:ionic-framework/core/src/components/accordion-group/accordion-group.tsx
Lines 208 to 210 in f14a59c
Fixing this in
ion-accordionshould hopefully be as simple asreturning early ifreadonlyis set here:ionic-framework/core/src/components/accordion/accordion.tsx
Line 384 in f14a59c