Skip to content

Commit

Permalink
fix: hide tooltip when not hovered (#2153)
Browse files Browse the repository at this point in the history
  • Loading branch information
enesozturk authored Apr 15, 2024
1 parent 165c720 commit 100b002
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/ui/src/composites/wui-tooltip-select/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export class WuiTooltipSelect extends LitElement {
private onMouseEnter() {
const element = this.shadowRoot?.querySelector('wui-tooltip')
if (element) {
element.style.display = 'flex'
element?.animate([{ opacity: 0 }, { opacity: 1 }], {
fill: 'forwards',
easing: 'ease',
Expand All @@ -43,6 +44,7 @@ export class WuiTooltipSelect extends LitElement {
private onMouseLeave() {
const element = this.shadowRoot?.querySelector('wui-tooltip')
if (element) {
element.style.display = 'none'
element?.animate([{ opacity: 1 }, { opacity: 0 }], {
fill: 'forwards',
easing: 'ease',
Expand Down
1 change: 1 addition & 0 deletions packages/ui/src/composites/wui-tooltip-select/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export default css`
left: 50%;
transform: translate(-50%, -100%);
opacity: 0;
display: none;
}
@media (hover: hover) and (pointer: fine) {
Expand Down

0 comments on commit 100b002

Please sign in to comment.