From e9e434cd2ecda0c5b0dd8ad6dde1c0db1eec2882 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Sat, 6 Feb 2021 23:48:59 -0500 Subject: [PATCH] Fix tooltips for tags box icons Addresses #1947 If we're going to need this regularly we should just create a React Image element that does this automatically for 'title'. --- chrome/content/zotero/components/itemPane/tagsBox.jsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero/components/itemPane/tagsBox.jsx b/chrome/content/zotero/components/itemPane/tagsBox.jsx index 9e20af4d6f..8d5f0db0c5 100644 --- a/chrome/content/zotero/components/itemPane/tagsBox.jsx +++ b/chrome/content/zotero/components/itemPane/tagsBox.jsx @@ -350,7 +350,9 @@ const TagsBox = React.forwardRef((props, ref) => { src={`chrome://zotero/skin/${iconFile}${Zotero.hiDPISuffix}.png`} alt={title} title={title} - tooltiptext={title} + /* Fix 'title' not working for HTML-in-XUL */ + onMouseOver={() => window.Zotero_Tooltip.start(title)} + onMouseOut={() => window.Zotero_Tooltip.stop()} style={{ width: "16px", height: "16px" }} onClick={props.editable ? (() => setSelectedTag(tag.tag)) : undefined} /> @@ -385,7 +387,9 @@ const TagsBox = React.forwardRef((props, ref) => { height="18" width="18" title={removeStr} - tooltiptext={removeStr} + /* Fix 'title' not working for HTML-in-XUL */ + onMouseOver={() => window.Zotero_Tooltip.start(removeStr)} + onMouseOut={() => window.Zotero_Tooltip.stop()} src={`chrome://zotero/skin/minus${Zotero.hiDPISuffix}.png`}/> )}