Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(kit): BadgedContent icon is positioned incorrectly when it's shown with a delay #8932

Merged
merged 1 commit into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading