Skip to content

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

Closed

Description

@averyrousseau

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:

Activity

  1. added a commit that references this issue on Jan 24, 2024
    e10f49c
  2. ionitron-bot commented on Feb 23, 2024

    @ionitron-bot

    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.

  3. locked and limited conversation to collaborators on Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions