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] <rh-accordion> is not responding to expanded-index or manually setting expanded attribute on headers #2019

Open
zeroedin opened this issue Oct 30, 2024 · 3 comments · May be fixed by #2035
Assignees
Labels
bug Something isn't working

Comments

@zeroedin
Copy link
Collaborator

zeroedin commented Oct 30, 2024

Reported by Alistair McGranaghan

this test code is not working for me:

<rh-accordion expanded-index="1" large="true">
  <rh-accordion-header>test title</rh-accordion-header>
  <rh-accordion-panel>
    <p>Test content</p>
  </rh-accordion-panel>
  <rh-accordion-header>test title 2</rh-accordion-header>
  <rh-accordion-panel>
    <p>Test content 2</p>
  </rh-accordion-panel>
</rh-accordion>

The initially expanded demo seems to work on ux.redhat.com

However if you try and to set expanded-index on the <rh-accordion> it does not respond. Here is a Codepen reproduction: https://codepen.io/zeroedin/pen/eYqrBxJ where I am setting expanded-index on the first example and expanded attributes on headers manually and programmatically in the second.

Alistair also mentioned that adding expanded on headers for him was not working in Shared Libs but I wasn't able to reproduce.

@zeroedin
Copy link
Collaborator Author

zeroedin commented Nov 5, 2024

Given shared_libs use I asked @zhawkins to run a test for me and he was not able to reproduce the expanded attribute issue using the following snippet:

<rh-accordion large="true">
  <rh-accordion-header>test title</rh-accordion-header>
  <rh-accordion-panel>
    <p>Test content</p>
  </rh-accordion-panel>
  <rh-accordion-header expanded>test title 2</rh-accordion-header>
  <rh-accordion-panel>
    <p>Test content 2</p>
  </rh-accordion-panel>
</rh-accordion>

Worked on his test environment:

image

@markcaron
Copy link
Collaborator

@zeroedin can we ensure the spec.ts catches this expanded feature?

@zeroedin
Copy link
Collaborator Author

zeroedin commented Nov 5, 2024

@markcaron https://github.com/patternfly/patternfly-elements/blob/96379988019be51ea4bce6146a9121c51c898a2b/elements/pf-accordion/test/pf-accordion.spec.ts#L226-L245

So we are testing for this in pf-accordion so we'd bring these tests over (as they apply) and add to them if needed. My thoughts are because we removed the direct relation to BaseAccordion we no longer had the tie in to the tests.

@zeroedin zeroedin linked a pull request Nov 6, 2024 that will close this issue
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Todo
Development

Successfully merging a pull request may close this issue.

2 participants