Skip to content

Commit 7fc5f68

Browse files
committed
chore: add comment to clarify what happens when disabled is true
Signed-off-by: Akshat Patel <[email protected]>
1 parent f57c1de commit 7fc5f68

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/tooltip/tooltip.component.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,11 @@ export class Tooltip extends PopoverContainer implements OnChanges, AfterContent
146146
// Ignore first change since content is not initialized
147147
if ((changes.autoAlign && !changes.autoAlign.firstChange)
148148
|| (changes.disabled && !changes.disabled.firstChange && !changes.disabled.currentValue)) {
149-
// On toggling `disabled`, we manually update view so querySelector can detect the popover content node
150-
// Otherwise, the position of the popover will be incorrect when autoAlign is enabled
149+
/**
150+
* When `disabled` is `true`, popover content node is removed. So when re-enabling `disabled`,
151+
* we manually update view so querySelector can detect the popover content node.
152+
* Otherwise, the position of the popover will be incorrect when autoAlign is enabled.
153+
*/
151154
this.changeDetectorRef.detectChanges();
152155

153156
// Reset the inline styles

0 commit comments

Comments
 (0)