Skip to content

Commit

Permalink
fix(kit): BadgedContent: icon is positioned incorrectly when it's sho…
Browse files Browse the repository at this point in the history
…wn with a delay
  • Loading branch information
mohan-mu committed Sep 10, 2024
1 parent 4853671 commit 4a26b1a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
15 changes: 13 additions & 2 deletions projects/kit/components/badged-content/badged-content.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
import {ChangeDetectionStrategy, Component} from '@angular/core';
import {
ChangeDetectionStrategy,
ChangeDetectorRef,
Component,
inject,
} from '@angular/core';
import {WaResizeObserver} from '@ng-web-apis/resize-observer';

import {TuiBadgedContentDirective} from './badged-content.directive';
Expand All @@ -11,4 +16,10 @@ import {TuiBadgedContentDirective} from './badged-content.directive';
styleUrls: ['./badged-content.style.less'],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class TuiBadgedContentComponent {}
export class TuiBadgedContentComponent {
private readonly cdr = inject(ChangeDetectorRef);

public onResize(): void {
this.cdr.detectChanges();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#badgeTop
class="t-badge t-badge_top"
[style.--t-badge-height.px]="badgeTop.offsetHeight"
(waResizeObserver)="(0)"
(waResizeObserver)="onResize()"
>
<ng-content select="tui-badge-notification[tuiSlot='top']" />
<div class="t-border">
Expand All @@ -16,7 +16,7 @@
#badgeBottom
class="t-badge t-badge_bottom"
[style.--t-badge-height.px]="badgeBottom.offsetHeight"
(waResizeObserver)="(0)"
(waResizeObserver)="onResize()"
>
<ng-content select="tui-badge-notification[tuiSlot='bottom']" />
<div class="t-border">
Expand Down

0 comments on commit 4a26b1a

Please sign in to comment.