-
Notifications
You must be signed in to change notification settings - Fork 841
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Show all breadcrumbs in a popover (#2342)
* Conditionally changing the ellipsis to a button. * Adding hook for popover state. * Showing breadcrumbs in a popover * Adding an aria-label * Changelog entry * Updating doc example text. * Using a badge style for the clickable ellipsis * PR review changes * Removing an unused selector * Update src/components/breadcrumbs/breadcrumbs.js Co-Authored-By: Caroline Horn <549577+cchaos@users.noreply.github.com> * Removing unnecessary ID * Only displaying the hidden items in the popover * Updating tests, removing rogue comment * Copy changes * Update src/components/breadcrumbs/breadcrumbs.js Co-Authored-By: Caroline Horn <549577+cchaos@users.noreply.github.com> * Updating a class name. * Refining the method of displaying hidden breadcrumbs.
- Loading branch information
1 parent
6bc63d1
commit 1076aeb
Showing
7 changed files
with
317 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
import React, { Fragment } from 'react'; | ||
|
||
import { EuiBreadcrumbs } from '../../../../src/components'; | ||
|
||
export default () => { | ||
const breadcrumbs = [ | ||
{ | ||
text: 'root', | ||
href: '#', | ||
onClick: e => { | ||
e.preventDefault(); | ||
console.log('You clicked root'); | ||
}, | ||
'data-test-subj': 'breadcrumbsroot', | ||
}, | ||
{ | ||
text: 'item 2', | ||
href: '#', | ||
onClick: e => { | ||
e.preventDefault(); | ||
console.log('You clicked src'); | ||
}, | ||
}, | ||
{ | ||
text: 'item 3', | ||
href: '#', | ||
onClick: e => { | ||
e.preventDefault(); | ||
console.log('You clicked item 3'); | ||
}, | ||
}, | ||
{ | ||
text: 'item 4', | ||
href: '#', | ||
onClick: e => { | ||
e.preventDefault(); | ||
console.log('You clicked item 4'); | ||
}, | ||
}, | ||
{ | ||
text: 'item 5', | ||
href: '#', | ||
onClick: e => { | ||
e.preventDefault(); | ||
console.log('You clicked item 5'); | ||
}, | ||
}, | ||
{ | ||
text: 'item 6', | ||
href: '#', | ||
onClick: e => { | ||
e.preventDefault(); | ||
console.log('You clicked item 6'); | ||
}, | ||
}, | ||
{ | ||
text: 'item 7', | ||
href: '#', | ||
onClick: e => { | ||
e.preventDefault(); | ||
console.log('You clicked item 7'); | ||
}, | ||
}, | ||
{ | ||
text: 'item 8', | ||
href: '#', | ||
onClick: e => { | ||
e.preventDefault(); | ||
console.log('You clicked item 8'); | ||
}, | ||
}, | ||
{ | ||
text: 'item 9', | ||
href: '#', | ||
onClick: e => { | ||
e.preventDefault(); | ||
console.log('You clicked item 9'); | ||
}, | ||
}, | ||
{ | ||
text: 'item 10', | ||
href: '#', | ||
onClick: e => { | ||
e.preventDefault(); | ||
console.log('You clicked item 10'); | ||
}, | ||
}, | ||
{ | ||
text: 'item 11', | ||
href: '#', | ||
onClick: e => { | ||
e.preventDefault(); | ||
console.log('You clicked item 11'); | ||
}, | ||
}, | ||
{ | ||
text: 'item 12', | ||
href: '#', | ||
onClick: e => { | ||
e.preventDefault(); | ||
console.log('You clicked item 12'); | ||
}, | ||
}, | ||
{ | ||
text: 'item 13', | ||
href: '#', | ||
onClick: e => { | ||
e.preventDefault(); | ||
console.log('You clicked item 13'); | ||
}, | ||
}, | ||
{ | ||
text: 'item 14', | ||
href: '#', | ||
onClick: e => { | ||
e.preventDefault(); | ||
console.log('You clicked item 14'); | ||
}, | ||
}, | ||
{ | ||
text: 'button_empty.tsx', | ||
}, | ||
]; | ||
|
||
return ( | ||
<Fragment> | ||
<EuiBreadcrumbs | ||
breadcrumbs={breadcrumbs} | ||
truncate={false} | ||
max={5} | ||
showMaxPopover | ||
/> | ||
</Fragment> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.