Skip to content

Commit

Permalink
Merge pull request #1635 from zyfra/fix/accordion-hint-change
Browse files Browse the repository at this point in the history
fix: accordion hint not shown if title changed #1415
  • Loading branch information
ZurabDev authored May 8, 2024
2 parents 6b2385f + 857b93a commit e5670bf
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,14 @@
<prizm-icons class="header-icon" [name]="$any(content)" size="16"></prizm-icons>
</ng-container>
</ng-container>
<div class="title" #elem *ngIf="title" [prizmHint]="title" [prizmHintCanShow]="prizmIsTextOverflow(elem)">
<ng-container *polymorphOutlet="title as content; context: data">
<div
class="title"
#elem
*ngIf="_title"
[prizmHint]="_title"
[prizmHintCanShow]="prizmIsTextOverflow(elem)"
>
<ng-container *polymorphOutlet="_title as content; context: data">
{{ content }}
</ng-container>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,13 @@ import { prizmIconsChevronsDoubleDown } from '@prizm-ui/icons/full/source';
})
export class PrizmAccordionItemComponent extends PrizmAbstractTestId implements OnInit, OnDestroy {
@Input() icon!: PolymorphContent<PrizmAccordionItemData>;
@Input() title: PolymorphContent<PrizmAccordionItemData> = '';
@Input()
set title(value: PolymorphContent<PrizmAccordionItemData>) {
this._title = value;
queueMicrotask(() => this.cdRef.markForCheck());
}

public _title: PolymorphContent<PrizmAccordionItemData> = '';
@Input() isExpanded = false;

@Input()
Expand All @@ -67,7 +73,7 @@ export class PrizmAccordionItemComponent extends PrizmAbstractTestId implements
get data() {
return {
icon: this.icon,
title: this.title,
title: this._title,
isExpanded: this.isExpanded,
disabled: this._disabled,
focused: this.isAccordionFocused,
Expand Down

0 comments on commit e5670bf

Please sign in to comment.