@ngrdt/menu 0.0.67 → 0.0.69

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.
@@ -11,7 +11,7 @@ import * as i3 from '@ngrdt/router';
11
11
  import { RdtRouterService, RdtAnyRouteActiveDirective } from '@ngrdt/router';
12
12
  import * as i4 from '@ngrdt/shortcuts';
13
13
  import { RdtShortcutService, RdtShortcut, RdtKeyListenerDirective } from '@ngrdt/shortcuts';
14
- import { RdtStringUtils, KB_CODE, RdtObjectUtils } from '@ngrdt/utils';
14
+ import { RdtStringUtils, KB_CODE, RdtObjectUtils, RdtDomUtils } from '@ngrdt/utils';
15
15
  import { delay, of, map, first, merge, fromEvent, throttleTime, animationFrameScheduler, switchMap, withLatestFrom } from 'rxjs';
16
16
  import { RDT_BUTTON_BASE_PROVIDER } from '@ngrdt/button';
17
17
 
@@ -833,11 +833,9 @@ class RdtMenuBaseComponent {
833
833
  constructor() {
834
834
  this.listenShortcuts();
835
835
  afterNextRender(() => {
836
- this.listenWindowResizeScroll();
837
- requestAnimationFrame(() => {
838
- this.measure();
839
- this.recalculateChildren();
840
- });
836
+ this.listenResizeScroll();
837
+ this.measure();
838
+ this.recalculateChildren();
841
839
  });
842
840
  }
843
841
  recalcChildrenEffect = effect(() => this.recalculateChildren());
@@ -1078,8 +1076,9 @@ class RdtMenuBaseComponent {
1078
1076
  this._buttonContainerRect = undefined;
1079
1077
  }
1080
1078
  }
1081
- listenWindowResizeScroll() {
1082
- merge(fromEvent(window, 'resize'), fromEvent(window, 'scroll'))
1079
+ listenResizeScroll() {
1080
+ const element = this.elRef.nativeElement;
1081
+ merge(RdtDomUtils.getResizeEvent$(element), fromEvent(window, 'scroll'))
1083
1082
  .pipe(throttleTime(0, animationFrameScheduler, { trailing: true }), takeUntilDestroyed(this.destroyRef))
1084
1083
  .subscribe(() => {
1085
1084
  this.measure();