-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Closed
Labels
package: core@ionic/core package@ionic/core packagetype: buga confirmed bug reporta confirmed bug report
Description
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
Ionic Info
N/A (reproducible from v7 docs)
Additional Information
ion-accordion-group doesn't exhibit this behavior because of this piece:
ionic-framework/core/src/components/accordion-group/accordion-group.tsx
Lines 208 to 210 in f14a59c
| if (readonly || disabled) { | |
| return; | |
| } |
Fixing this in ion-accordion should hopefully be as simple as returning early if readonly is set here:
| private toggleExpanded() { |
Metadata
Metadata
Assignees
Labels
package: core@ionic/core package@ionic/core packagetype: buga confirmed bug reporta confirmed bug report