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
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() { |