cats-data-grid 2.0.72 → 2.0.73

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -968,6 +968,12 @@ class TooltipDirective {
968
968
  }
969
969
  ngOnInit() {
970
970
  this.renderer.addClass(this.elementRef.nativeElement, 'tooltip-trigger');
971
+ this.ngZone.onStable.subscribe(() => {
972
+ const el = this.elementRef.nativeElement;
973
+ if (!el.isConnected || !document.body.contains(el)) {
974
+ this.hide();
975
+ }
976
+ });
971
977
  }
972
978
  onMouseEnter(event) {
973
979
  if (!this.content)
@@ -1021,7 +1027,8 @@ class TooltipDirective {
1021
1027
  }
1022
1028
  // If still not found, use the whole element
1023
1029
  if (!this.tooltipElement) {
1024
- this.tooltipElement = componentRef.location.nativeElement;
1030
+ this.tooltipElement = componentRef.location
1031
+ .nativeElement;
1025
1032
  }
1026
1033
  // Append to body to avoid layout issues
1027
1034
  this.renderer.appendChild(document.body, componentRef.location.nativeElement);
@@ -1140,18 +1147,30 @@ class TooltipDirective {
1140
1147
  switch (this.currentPosition) {
1141
1148
  case 'top':
1142
1149
  top = this.elementRect.top - tooltipRect.height - gap;
1143
- left = this.elementRect.left + this.elementRect.width / 2 - tooltipRect.width / 2;
1150
+ left =
1151
+ this.elementRect.left +
1152
+ this.elementRect.width / 2 -
1153
+ tooltipRect.width / 2;
1144
1154
  break;
1145
1155
  case 'bottom':
1146
1156
  top = this.elementRect.bottom + gap;
1147
- left = this.elementRect.left + this.elementRect.width / 2 - tooltipRect.width / 2;
1157
+ left =
1158
+ this.elementRect.left +
1159
+ this.elementRect.width / 2 -
1160
+ tooltipRect.width / 2;
1148
1161
  break;
1149
1162
  case 'left':
1150
- top = this.elementRect.top + this.elementRect.height / 2 - tooltipRect.height / 2;
1163
+ top =
1164
+ this.elementRect.top +
1165
+ this.elementRect.height / 2 -
1166
+ tooltipRect.height / 2;
1151
1167
  left = this.elementRect.left - tooltipRect.width - gap;
1152
1168
  break;
1153
1169
  case 'right':
1154
- top = this.elementRect.top + this.elementRect.height / 2 - tooltipRect.height / 2;
1170
+ top =
1171
+ this.elementRect.top +
1172
+ this.elementRect.height / 2 -
1173
+ tooltipRect.height / 2;
1155
1174
  left = this.elementRect.right + gap;
1156
1175
  break;
1157
1176
  }