Skip to content

Commit

Permalink
fix(ld-sidenav): show tooltip with slotted icon
Browse files Browse the repository at this point in the history
  • Loading branch information
borisdiakur committed Apr 1, 2022
1 parent 2b80985 commit 7a8d409
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,12 @@ export class LdSidenavNavitem implements InnerFocusable {
this.sidenavAlignement = this.sidenav.align
this.sidenavExpandsOnMouseEnter =
this.sidenav.expandTrigger === 'mouseenter'
if (
!['secondary', 'tertiary'].includes(this.mode) &&
!this.el.querySelector('[slot="icon"]')
) {
if (!['secondary', 'tertiary'].includes(this.mode)) {
this.tooltipContent = this.el.textContent.trim()
this.abbreviation = this.getabbreviation()

if (!this.el.querySelector('[slot="icon"]')) {
this.abbreviation = this.getabbreviation()
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,9 @@ exports[`ld-sidenav collapses to narrow 1`] = `
</mock:shadow-root>
<div class="ld-sidenav-navitem__tooltip-trigger" slot="trigger"></div>
<div class="ld-sidenav-navitem__tooltip-content">
<ld-typo></ld-typo>
<ld-typo>
Artificial intelligence
</ld-typo>
</div>
</ld-tooltip>
</div>
Expand Down

0 comments on commit 7a8d409

Please sign in to comment.