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

make dropdown/app launcher work better with router components #3011

Merged
merged 1 commit into from Sep 26, 2019

Conversation

@jschuler
Copy link
Collaborator

jschuler commented Sep 25, 2019

Closes: #2451, #2317

We don't always want to render our own <a> component as a wrapper for the item content inside the <li>, because if user were to do

<ApplicationLauncherItem>
  <Link to="/router/link">Router link</Link>
</ApplicationLauncherItem>

they'd end up with doubly nested anchors which is not to HTML spec.
Instead, allow them to define the component that renders the content

<ApplicationLauncherItem component={
    <Text component="a" href="#" style={exampleStyle}>Router link</Text>
} />

Previously the app launcher was incorrectly rendering the router link component within a div and only the text on the link was clickable. Now the whole item is correctly clickable.

@patternfly-build

This comment has been minimized.

Copy link
Contributor

patternfly-build commented Sep 25, 2019

PatternFly-React preview: https://patternfly-react-pr-3011.surge.sh

@tlabaj tlabaj requested a review from kmcfaul Sep 25, 2019
@tlabaj tlabaj requested a review from dlabrecq Sep 25, 2019
Copy link
Contributor

redallen left a comment

I would have liked to see our API designed better to begin with to handle different typeof children. This works, though, and is the way to not introduce breaking changes.

@redallen redallen merged commit 169ad6b into patternfly:master Sep 26, 2019
8 checks passed
8 checks passed
ci/circleci: build Your tests passed on CircleCI!
Details
ci/circleci: build_integration Your tests passed on CircleCI!
Details
ci/circleci: build_pf3_docs Your tests passed on CircleCI!
Details
ci/circleci: build_pf4_docs Your tests passed on CircleCI!
Details
ci/circleci: lint Your tests passed on CircleCI!
Details
ci/circleci: test_jest_other Your tests passed on CircleCI!
Details
ci/circleci: test_jest_pf4 Your tests passed on CircleCI!
Details
ci/circleci: upload_docs Your tests passed on CircleCI!
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.