1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-14 02:06:29 +00:00

Tooltip misplaced (#3499)

* fix bug: tooltip misplaced

* Transition only opacity attributes
This commit is contained in:
Aaron Bird
2020-03-04 02:56:31 +08:00
committed by GitHub
parent 88e8d2e009
commit 9549355ab7
3 changed files with 25 additions and 1 deletions

View File

@@ -21,7 +21,9 @@ const FolderIcon = ({ className, color, isActive }) => {
/**
* @param {boolean} isActive
* @param {object} tooltipRef,
* @param {Function} handleButtonClick
* @param {Function} handleMouseEnter
* @param {Function} handleContextMenu
* @param {string} folderName
* @param {string} folderColor
@@ -35,7 +37,9 @@ const FolderIcon = ({ className, color, isActive }) => {
const StorageItem = ({
styles,
isActive,
tooltipRef,
handleButtonClick,
handleMouseEnter,
handleContextMenu,
folderName,
folderColor,
@@ -49,6 +53,7 @@ const StorageItem = ({
<button
styleName={isActive ? 'folderList-item--active' : 'folderList-item'}
onClick={handleButtonClick}
onMouseEnter={handleMouseEnter}
onContextMenu={handleContextMenu}
onDrop={handleDrop}
onDragEnter={handleDragEnter}
@@ -75,7 +80,9 @@ const StorageItem = ({
<span styleName='folderList-item-noteCount'>{noteCount}</span>
)}
{isFolded && (
<span styleName='folderList-item-tooltip'>{folderName}</span>
<span styleName='folderList-item-tooltip' ref={tooltipRef}>
{folderName}
</span>
)}
</button>
)
@@ -83,7 +90,9 @@ const StorageItem = ({
StorageItem.propTypes = {
isActive: PropTypes.bool.isRequired,
tooltipRef: PropTypes.object,
handleButtonClick: PropTypes.func,
handleMouseEnter: PropTypes.func,
handleContextMenu: PropTypes.func,
folderName: PropTypes.string.isRequired,
folderColor: PropTypes.string,