Skip to content

Commit

Permalink
multi select tooltip fix
Browse files Browse the repository at this point in the history
  • Loading branch information
maruthumj authored and nbrown-ScottLogic committed May 1, 2024
1 parent 0d43e64 commit b84578a
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/app/components/multiselect/multiselect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,15 @@ export class MultiSelectItem {
[autofocus]="autofocus"
/>
</div>
<div class="p-multiselect-label-container" [pTooltip]="tooltip" [tooltipPosition]="tooltipPosition" [positionStyle]="tooltipPositionStyle" [tooltipStyleClass]="tooltipStyleClass">
<div
class="p-multiselect-label-container"
[pTooltip]="tooltip"
(mouseleave)="labelContainerMouseLeave()"
[tooltipDisabled]="_disableTooltip"
[tooltipPosition]="tooltipPosition"
[positionStyle]="tooltipPositionStyle"
[tooltipStyleClass]="tooltipStyleClass"
>
<div [ngClass]="labelClass">
<ng-container *ngIf="!selectedItemsTemplate">
<ng-container *ngIf="display === 'comma'">{{ label() || 'empty' }}</ng-container>
Expand Down Expand Up @@ -921,6 +929,8 @@ export class MultiSelect implements OnInit, AfterViewInit, AfterContentInit, Aft

_selectionLimit: number | undefined;

_disableTooltip = false;

value: any[];

public _filteredOptions: any[] | undefined | null;
Expand Down Expand Up @@ -2025,10 +2035,15 @@ export class MultiSelect implements OnInit, AfterViewInit, AfterContentInit, Aft
this.updateModel(null, event);
this.selectedOptions = null;
this.onClear.emit();
this._disableTooltip = true;

event.stopPropagation();
}

labelContainerMouseLeave() {
if (this._disableTooltip) this._disableTooltip = false;
}

removeOption(optionValue, event) {
let value = this.modelValue().filter((val) => !ObjectUtils.equals(val, optionValue, this.equalityKey()));

Expand Down

0 comments on commit b84578a

Please sign in to comment.