Don't truncate tags unnecessarily if width is miscalculated
https://forums.zotero.org/discussion/76665/tag-issue-display-of-some-tags-erratic
This commit is contained in:
parent
ecdcb65f57
commit
3ca5ac421c
1 changed files with 8 additions and 0 deletions
|
@ -132,6 +132,14 @@ class TagList extends React.PureComponent {
|
|||
...style
|
||||
};
|
||||
|
||||
// Don't specify explicit width unless we're truncating, because for some reason the width
|
||||
// from canvas can sometimes be slightly smaller than the actual width, resulting in an
|
||||
// unnecessary ellipsis.
|
||||
var tagMaxWidth = this.props.width - minHorizontalPadding;
|
||||
if (props.style.width < tagMaxWidth) {
|
||||
delete props.style.width;
|
||||
}
|
||||
|
||||
if (tag.color) {
|
||||
props.style.color = tag.color;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue