This repository was archived by the owner on Jan 13, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +1
-3
lines changed
Expand file tree Collapse file tree 1 file changed +1
-3
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,6 @@ export class MDCTooltip extends MDCComponent<MDCTooltipFoundation> {
3434 }
3535
3636 private anchorElem ! : HTMLElement ; // assigned in initialize
37- private tooltipElem ! : HTMLElement | null ; // assigned in initialize
3837 private isTooltipRich ! : boolean ; // assigned in initialSyncWithDOM
3938 private isTooltipPersistent ! : boolean ; // assigned in initialSyncWithDOM
4039
@@ -54,7 +53,6 @@ export class MDCTooltip extends MDCComponent<MDCTooltipFoundation> {
5453 const anchorElem = document . querySelector < HTMLElement > (
5554 `[aria-describedby="${ tooltipId } "]` ) ||
5655 document . querySelector < HTMLElement > ( `[data-tooltip-id="${ tooltipId } "]` ) ;
57- this . tooltipElem = document . querySelector < HTMLElement > ( `#${ tooltipId } ` ) ;
5856 if ( ! anchorElem ) {
5957 throw new Error (
6058 'MDCTooltip: Tooltip component requires an anchor element annotated with [aria-describedby] or [data-tooltip-id] anchor element.' ) ;
@@ -167,7 +165,7 @@ export class MDCTooltip extends MDCComponent<MDCTooltipFoundation> {
167165 return ! ! this . anchorElem ?. contains ( element ) ;
168166 } ,
169167 tooltipContainsElement : ( element ) => {
170- return ! ! this . tooltipElem ? .contains ( element ) ;
168+ return this . root . contains ( element ) ;
171169 } ,
172170 registerEventHandler : ( evt , handler ) => {
173171 if ( this . root instanceof HTMLElement ) {
You can’t perform that action at this time.
0 commit comments