Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: readonly accordion can be opened using keyboard controls #28344

Closed
3 tasks done
averyjohnston opened this issue Oct 12, 2023 · 1 comment · Fixed by #28865
Closed
3 tasks done

bug: readonly accordion can be opened using keyboard controls #28344

averyjohnston opened this issue Oct 12, 2023 · 1 comment · Fixed by #28865
Labels
package: core @ionic/core package type: bug a confirmed bug report

Comments

@averyjohnston
Copy link
Contributor

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

  1. Navigate to https://ionicframework.com/docs/api/accordion#individual-accordion-1
  2. Use the Tab key to focus the second accordion
  3. 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:

@ionitron-bot ionitron-bot bot added the triage label Oct 12, 2023
@averyjohnston averyjohnston added package: core @ionic/core package type: bug a confirmed bug report labels Oct 12, 2023
@ionitron-bot ionitron-bot bot removed the triage label Oct 12, 2023
github-merge-queue bot pushed a commit that referenced this issue Jan 24, 2024
…28865)

Issue number: resolves #28344

---------

<!-- Please do not submit updates to dependencies unless it fixes an
issue. -->

<!-- Please try to limit your pull request to one type (bugfix, feature,
etc). Submit multiple pull requests if needed. -->

## What is the current behavior?
<!-- Please describe the current behavior that you are modifying. -->
When an Accordion is inside an Accordion Group, and the Accordion Group
is enabled and not readonly but the Accordion is disabled and/or
readonly, it is possible to navigate to the accordion and open it using
the keyboard. This should not be allowed, just like opening it on click
is not allowed.

## What is the new behavior?
<!-- Please describe the behavior or changes that are being added by
this PR. -->

- A disabled Accordion inside an Accordion Group may not be opened via
the keyboard.
- A readonly Accordion inside an Accordion Group may not be opened via
the keyboard.

## Does this introduce a breaking change?

- [ ] Yes
- [x] No

<!--
  If this introduces a breaking change:
1. Describe the impact and migration path for existing applications
below.
  2. Update the BREAKING.md file with the breaking change.
3. Add "BREAKING CHANGE: [...]" to the commit description when merging.
See
https://github.com/ionic-team/ionic-framework/blob/main/.github/CONTRIBUTING.md#footer
for more information.
-->


## Other information

<!-- Any other information that is important to this PR such as
screenshots of how the component looks before and after the change. -->
Copy link

ionitron-bot bot commented Feb 23, 2024

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Feb 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
package: core @ionic/core package type: bug a confirmed bug report
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant