Title hover for truncated text

This commit is contained in:
dannyrb authored and James A. Petts committed 2020-05-15 14:01:59 +02:00
1 parent 8dac6d7318
commit 36bc73579d
2 files changed
+12 -5

No files matched your search

@@ -35,22 +35,20 @@ const StudyListTableRow = props => {
onClick={onClickRow}
>
{row.map((cell, index) => {
const { content, gridCol, name } = cell;
const { content, title, gridCol, name } = cell;
return (
<td
key={name}
className={classnames(
'px-4 py-2 text-base',
'px-4 py-2 text-base truncate',
{ 'border-b border-secondary-light': !isExpanded },
`w-${gridCol}/24` || ''
)}
style={{
maxWidth: 0,
overflow: 'hidden',
textOverflow: 'ellipsis',
whiteSpace: 'nowrap',
}}
title={title}
>
{index === 0 && (
<Icon
@@ -83,6 +81,8 @@ StudyListTableRow.propTypes = {
PropTypes.shape({
key: PropTypes.string.isRequired,
content: PropTypes.node.isRequired,
/** Title attribute to use for provided content */
title: PropTypes.string,
gridCol: PropTypes.number.isRequired,
})
).isRequired,