igniteui-angular 21.1.4 → 21.1.5

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.
@@ -3831,6 +3831,9 @@ class IgxForOfDirective extends IgxForOfToken {
3831
3831
  this._sizesCache = [];
3832
3832
  this._differ = null;
3833
3833
  this.individualSizeCache = [];
3834
+ /**
3835
+ * @hidden
3836
+ */
3834
3837
  /** Internal track for scroll top that is being virtualized */
3835
3838
  this._virtScrollPosition = 0;
3836
3839
  /** If the next onScroll event is triggered due to internal setting of scrollTop */
@@ -4413,7 +4416,7 @@ class IgxForOfDirective extends IgxForOfToken {
4413
4416
  const maxVirtScrollTop = this._virtSize - containerSize;
4414
4417
  this._bScrollInternal = true;
4415
4418
  this._virtScrollPosition = maxVirtScrollTop;
4416
- this.scrollPosition = maxVirtScrollTop;
4419
+ this.scrollPosition = maxVirtScrollTop / this._virtRatio;
4417
4420
  return;
4418
4421
  }
4419
4422
  if (this._adjustToIndex) {
@@ -4997,11 +5000,13 @@ class IgxForOfDirective extends IgxForOfToken {
4997
5000
  let currentScroll = this.scrollPosition;
4998
5001
  if (this._virtRatio !== 1) {
4999
5002
  this._calcVirtualScrollPosition(this.scrollPosition);
5000
- currentScroll = this._virtScrollPosition;
5003
+ scrollOffset = this.fixedUpdateAllElements(this._virtScrollPosition);
5004
+ }
5005
+ else {
5006
+ const scroll = this.scrollComponent.nativeElement;
5007
+ scrollOffset = scroll && this.scrollComponent.size ?
5008
+ currentScroll - this.sizesCache[this.state.startIndex] : 0;
5001
5009
  }
5002
- const scroll = this.scrollComponent.nativeElement;
5003
- scrollOffset = scroll && this.scrollComponent.size ?
5004
- currentScroll - this.sizesCache[this.state.startIndex] : 0;
5005
5010
  const dir = this.igxForScrollOrientation === 'horizontal' ? 'left' : 'transform';
5006
5011
  this.dc.instance._viewContainer.element.nativeElement.style[dir] = this.igxForScrollOrientation === 'horizontal' ?
5007
5012
  -(scrollOffset) + 'px' :
@@ -8179,6 +8184,7 @@ class IgxTooltipTargetDirective extends IgxToggleActionDirective {
8179
8184
  this._positionSettings = TooltipPositionSettings;
8180
8185
  this._showTriggers = new Set(['pointerenter']);
8181
8186
  this._hideTriggers = new Set(['pointerleave', 'click']);
8187
+ this._pendingShowTrigger = null;
8182
8188
  this._abortController = new AbortController();
8183
8189
  }
8184
8190
  /**
@@ -8399,14 +8405,18 @@ class IgxTooltipTargetDirective extends IgxToggleActionDirective {
8399
8405
  /**
8400
8406
  * @hidden
8401
8407
  */
8402
- onShow() {
8403
- this._checksBeforeShowing(() => this._showOnInteraction());
8408
+ onShow(event) {
8409
+ this._checksBeforeShowing(() => this._showOnInteraction(event));
8404
8410
  }
8405
8411
  /**
8406
8412
  * @hidden
8407
8413
  */
8408
- onHide() {
8409
- if (this.tooltipDisabled || this.target.collapsed) {
8414
+ onHide(event) {
8415
+ if (this.target.collapsed) {
8416
+ this._cancelPendingShow(event);
8417
+ return;
8418
+ }
8419
+ if (this.tooltipDisabled) {
8410
8420
  return;
8411
8421
  }
8412
8422
  this._checkOutletAndOutsideClick();
@@ -8517,7 +8527,7 @@ class IgxTooltipTargetDirective extends IgxToggleActionDirective {
8517
8527
  this.target.close();
8518
8528
  }, withDelay ? this.hideDelay : 0);
8519
8529
  }
8520
- _showTooltip(withDelay, withEvents) {
8530
+ _showTooltip(withDelay, withEvents, triggerEvent) {
8521
8531
  if (!this.target.collapsed && !this._isForceClosed) {
8522
8532
  return;
8523
8533
  }
@@ -8531,14 +8541,16 @@ class IgxTooltipTargetDirective extends IgxToggleActionDirective {
8531
8541
  return;
8532
8542
  }
8533
8543
  this._evaluateStickyState();
8544
+ this._pendingShowTrigger = triggerEvent?.type ?? null;
8534
8545
  this.target.timeoutId = setTimeout(() => {
8535
8546
  // Call open() of IgxTooltipDirective
8547
+ this._pendingShowTrigger = null;
8536
8548
  this.target.open(this._mergedOverlaySettings);
8537
8549
  }, withDelay ? this.showDelay : 0);
8538
8550
  }
8539
- _showOnInteraction() {
8551
+ _showOnInteraction(triggerEvent) {
8540
8552
  this._stopTimeoutAndAnimation();
8541
- this._showTooltip(true, true);
8553
+ this._showTooltip(true, true, triggerEvent);
8542
8554
  }
8543
8555
  _hideOnInteraction() {
8544
8556
  if (this.target?.tooltipTarget?.sticky) {
@@ -8561,6 +8573,23 @@ class IgxTooltipTargetDirective extends IgxToggleActionDirective {
8561
8573
  clearTimeout(this.target.timeoutId);
8562
8574
  this.target.stopAnimations();
8563
8575
  }
8576
+ /**
8577
+ * Used when a hide trigger occurs before the tooltip opens.
8578
+ * Clears the pending timeout and resets the tracked show trigger
8579
+ * so the tooltip does not open after the user has already left the target.
8580
+ */
8581
+ _cancelPendingShow(event) {
8582
+ if (!this.target.timeoutId) {
8583
+ return;
8584
+ }
8585
+ // Keep same-event show/hide trigger combinations acting as toggle behavior.
8586
+ if (event?.type && event.type === this._pendingShowTrigger) {
8587
+ return;
8588
+ }
8589
+ clearTimeout(this.target.timeoutId);
8590
+ this.target.timeoutId = null;
8591
+ this._pendingShowTrigger = null;
8592
+ }
8564
8593
  /**
8565
8594
  * Used when a single tooltip is used for multiple targets.
8566
8595
  */