fix recently accessed overflow problems (#18726)

This commit is contained in:
Nathan Reese 2018-05-08 12:44:54 -06:00 committed by GitHub
parent 5fcf7bc171
commit 147d208e2d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 42 additions and 21 deletions

View file

@ -27,7 +27,7 @@ exports[`render 1`] = `
gutterSize="l"
justifyContent="spaceBetween"
responsive={true}
wrap={false}
wrap={true}
>
<EuiFlexItem
className="recentlyAccessedFlexItem"
@ -56,14 +56,19 @@ exports[`render 1`] = `
}
}
>
<EuiLink
className="recentlyAccessedLongLink"
color="primary"
href="link0"
type="button"
<EuiToolTip
content="label0"
position="bottom"
>
label0
</EuiLink>
<EuiLink
className="recentlyAccessedLongLink"
color="primary"
href="link0"
type="button"
>
label0
</EuiLink>
</EuiToolTip>
</EuiFlexItem>
</React.Fragment>
<React.Fragment
@ -94,14 +99,19 @@ exports[`render 1`] = `
}
}
>
<EuiLink
className="recentlyAccessedLongLink"
color="primary"
href="link1"
type="button"
<EuiToolTip
content="label1"
position="bottom"
>
label1
</EuiLink>
<EuiLink
className="recentlyAccessedLongLink"
color="primary"
href="link1"
type="button"
>
label1
</EuiLink>
</EuiToolTip>
</EuiFlexItem>
</React.Fragment>
</EuiFlexGroup>

View file

@ -12,6 +12,7 @@ import {
EuiPopover,
EuiIcon,
EuiSpacer,
EuiToolTip,
} from '@elastic/eui';
export const NUM_LONG_LINKS = 5;
@ -130,12 +131,17 @@ export class RecentlyAccessed extends Component {
style={style}
grow={false}
>
<EuiLink
className="recentlyAccessedLongLink"
href={recentlyAccessedItem.link}
<EuiToolTip
position="bottom"
content={recentlyAccessedItem.label}
>
{recentlyAccessedItem.label}
</EuiLink>
<EuiLink
className="recentlyAccessedLongLink"
href={recentlyAccessedItem.link}
>
{recentlyAccessedItem.label}
</EuiLink>
</EuiToolTip>
</EuiFlexItem>
</React.Fragment>
);
@ -178,7 +184,7 @@ export class RecentlyAccessed extends Component {
<EuiSpacer size="s"/>
<EuiFlexGroup justifyContent="spaceBetween" alignItems="flexEnd">
<EuiFlexGroup justifyContent="spaceBetween" alignItems="flexEnd" wrap>
<EuiFlexItem grow={false} className="recentlyAccessedFlexItem">
<EuiFlexGroup>
{this.renderRecentlyAccessed()}

View file

@ -7,6 +7,11 @@
.recentlyAccessedItem {
overflow: hidden;
max-width: 300px;
.euiToolTipAnchor {
overflow: hidden;
text-overflow: ellipsis;
}
}
.recentlyAccessedLongLink {