mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-23 17:08:34 +00:00
Hide tooltip when the left sidebar icon is clicked (#531)
* Fix the bug * dealy tooltip and postion it to right Co-authored-by: “Apoorv <“tiwari.apoorv1316@gmail.com”>
This commit is contained in:
parent
a53cac24b2
commit
6277061938
1 changed files with 5 additions and 3 deletions
|
|
@ -3,17 +3,19 @@ import OverlayTrigger from 'react-bootstrap/OverlayTrigger';
|
|||
import Tooltip from 'react-bootstrap/Tooltip';
|
||||
|
||||
export const LeftSidebarItem = ({ tip = '', className, icon, text, onClick, ...rest }) => {
|
||||
|
||||
return (
|
||||
<OverlayTrigger
|
||||
placement="bottom"
|
||||
delay={{ show: 250, hide: 400 }}
|
||||
trigger={['click','hover', 'focus']}
|
||||
placement="right"
|
||||
delay={{ show: 800, hide: 100 }}
|
||||
overlay={<Tooltip id="button-tooltip">
|
||||
{tip}
|
||||
</Tooltip>}
|
||||
>
|
||||
<div {...rest} className={className} onClick={onClick && onClick}>
|
||||
{icon && <img className="svg-icon" src={`/assets/images/icons/editor/left-sidebar/${icon}.svg`} width="20" height="20" />}
|
||||
{text && text}
|
||||
{text && text}
|
||||
</div>
|
||||
</OverlayTrigger>
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in a new issue