From 3ca5ac421c71d2fae43cc74d4fd410824f660b5a Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Sun, 31 Mar 2019 07:37:24 -0400 Subject: [PATCH] Don't truncate tags unnecessarily if width is miscalculated https://forums.zotero.org/discussion/76665/tag-issue-display-of-some-tags-erratic --- .../content/zotero/components/tag-selector/tag-list.jsx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/chrome/content/zotero/components/tag-selector/tag-list.jsx b/chrome/content/zotero/components/tag-selector/tag-list.jsx index a582cb7e1b..837310297c 100644 --- a/chrome/content/zotero/components/tag-selector/tag-list.jsx +++ b/chrome/content/zotero/components/tag-selector/tag-list.jsx @@ -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; }