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

pfe-dropdown: role attribute not set properly in React and Vue #1010

Open
kylebuch8 opened this issue Jul 28, 2020 · 0 comments
Open

pfe-dropdown: role attribute not set properly in React and Vue #1010

kylebuch8 opened this issue Jul 28, 2020 · 0 comments
Labels
fix needs: prioritization To be prioritized priority: low Severity level: 3

Comments

@kylebuch8
Copy link
Contributor

kylebuch8 commented Jul 28, 2020

pfe-dropdown: role attribute not set properly in React and Vue

This test fails in React and Vue.
https://github.com/patternfly/patternfly-elements/blob/master/elements/pfe-dropdown/test/pfe-dropdown_test.html#L82

Impacted component(s)

  • pfe-dropdown and pfe-dropdown-item

Steps to reproduce

  1. Go to https://codesandbox.io/s/pfe-dropdown-issue-1010-qwsqd
  2. View the React version and the plain HTML version
  3. The role attribute on the first pfe-dropdown-item is not present
  4. See that the role attribute on the first pfe-dropdown-item is present in the plain HTML version

Expected behavior

The role of the pfe-dropdown-item should be a menu item if the pfe-item-type is a link.

Screenshots

image

Developer notes

I suspect it's an issue related to the timing of finding this._item in the slot in the constructor of PfeDropdownItem. This shouldn't be done in the constructor. And since the attributeChangedCallback is firing before the connectedCallback, we can't set this._item in the connectedCallback either. I think we'll need to set this._item in the attributeChangedCallback.

https://github.com/patternfly/patternfly-elements/blob/master/elements/pfe-dropdown/src/pfe-dropdown-item.js#L28

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix needs: prioritization To be prioritized priority: low Severity level: 3
Projects
None yet
Development

No branches or pull requests

2 participants