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

Allowing the last item in the breadcrumbs to be clickable. #1905

Merged
merged 7 commits into from
May 1, 2019
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

**Bug fixes**

- The last item in breadcrumbs is now clickable when an `href` is provided ([#1905](https://github.com/elastic/eui/pull/1905))
daveyholler marked this conversation as resolved.
Show resolved Hide resolved
- Fixed overflow scrolling of `EuiModal` and `EuiConfirmModal` for Chrome and Safari ([#1902](https://github.com/elastic/eui/pull/1902))
- Fixed `EuiOverlayMask` `children` element mismatch TS error ([#1900](https://github.com/elastic/eui/pull/1900))

Expand Down
6 changes: 4 additions & 2 deletions src-docs/src/views/breadcrumbs/breadcrumbs_example.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@ export const BreadcrumbsExample = {
text: (
<p>
<EuiCode>EuiBreadcrumbs</EuiCode> let the user track their progress within and back out of
a UX flow. They work well within <EuiCode>EuiPageContentHeader</EuiCode> but be careful
not to be use them within an app that also uses <EuiCode>EuiHeaderBreadcrumbs</EuiCode>.
a UX flow. You can provide an <EuiCode>href</EuiCode> prop on any breadcrumb item that you
wish to make clickable, including the last item. They work well within
daveyholler marked this conversation as resolved.
Show resolved Hide resolved
<EuiCode>EuiPageContentHeader</EuiCode> but be careful not to be use them within an app that
also uses <EuiCode>EuiHeaderBreadcrumbs</EuiCode>.
</p>
),
props: { EuiBreadcrumbs },
Expand Down
6 changes: 3 additions & 3 deletions src/components/breadcrumbs/breadcrumbs.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export const EuiBreadcrumbs = ({ breadcrumbs, className, responsive, truncate, m

let link;

if (isLastBreadcrumb) {
if (isLastBreadcrumb && !href) {
link = (
<span
className={breadcrumbClasses}
Expand All @@ -78,9 +78,9 @@ export const EuiBreadcrumbs = ({ breadcrumbs, className, responsive, truncate, m
} else {
link = (
<EuiLink
color="subdued"
href={href}
color={isLastBreadcrumb ? 'text' : 'subdued'}
onClick={onClick}
href={href}
className={breadcrumbClasses}
title={text}
{...breadcrumbRest}
Expand Down