Skip to content

Commit

Permalink
fix(ui) Fix overflowing tag values (#13648)
Browse files Browse the repository at this point in the history
Tags with longer values were causing the tag table to break out of the
modal and overflow out of the viewport. Using `table-layout:fixed`
solves this along with overflowEllipsis.

Refs SEN-716
  • Loading branch information
markstory authored Jun 12, 2019
1 parent 00d3c85 commit 1a37030
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ import {withRouter} from 'react-router';
import Link from 'app/components/links/link';
import {t} from 'app/locale';
import space from 'app/styles/space';
import overflowEllipsis from 'app/styles/overflowEllipsis';
import {getEventTagSearchUrl} from './utils';

const TagsTable = props => {
return (
<div>
<TagHeading>{t('Tags')}</TagHeading>
<table>
<StyledTable>
<tbody>
{props.tags.map(tag => (
<StyledTr key={tag.key}>
Expand All @@ -25,7 +26,7 @@ const TagsTable = props => {
</StyledTr>
))}
</tbody>
</table>
</StyledTable>
</div>
);
};
Expand All @@ -34,6 +35,12 @@ TagsTable.propTypes = {
location: PropTypes.object,
};

const StyledTable = styled('table')`
table-layout: fixed;
width: 100%;
max-width: 100%;
`;

const TagHeading = styled('h5')`
text-transform: uppercase;
color: ${p => p.theme.gray3};
Expand All @@ -55,6 +62,7 @@ const TagKey = styled('td')`

const TagValue = styled(TagKey)`
text-align: right;
${overflowEllipsis};
`;

export default withRouter(TagsTable);

0 comments on commit 1a37030

Please sign in to comment.