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'.
This commit is contained in:
Dan Stillman 2021-02-06 23:48:59 -05:00
parent 01819d68d1
commit e9e434cd2e

View file

@ -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`}/>
</button>)}
</li>