File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed
Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -438,15 +438,13 @@ export default class IgcTooltipComponent extends EventEmitterMixin<
438438 }
439439
440440 private _checkForCustomContent ( ) : void {
441- if ( this . _defaultSlot ) {
442- const assignedNodes = this . _defaultSlot . assignedNodes ( { flatten : true } ) ;
443- // If there are assigned nodes, we have custom content
444- this . _hasCustomContent = assignedNodes . length > 0 ;
441+ if ( ! this . _defaultSlot ) {
442+ this . _hasCustomContent = false ;
443+ return ;
445444 }
446- }
447-
448- private _handleSlotChange ( ) : void {
449- this . _checkForCustomContent ( ) ;
445+ const assignedNodes = this . _defaultSlot . assignedNodes ( { flatten : true } ) ;
446+ // If there are assigned nodes, we have custom content
447+ this . _hasCustomContent = assignedNodes . length > 0 ;
450448 }
451449
452450 protected override render ( ) {
@@ -468,7 +466,9 @@ export default class IgcTooltipComponent extends EventEmitterMixin<
468466 shift
469467 >
470468 < div ${ ref ( this . _containerRef ) } part ="base " class =${ classMap ( classes ) } >
471- < slot @slotchange =${ this . _handleSlotChange } > ${ this . message } </ slot >
469+ < slot @slotchange =${ this . _checkForCustomContent }
470+ > ${ this . message } </ slot
471+ >
472472 ${ this . sticky
473473 ? html `
474474 < slot name ="close-button " @click =${ this . _setAutoHide } >
You can’t perform that action at this time.
0 commit comments