Skip to content

Commit

Permalink
Merge pull request #15322 from maruthumj/multi-select-tooltip
Browse files Browse the repository at this point in the history
Bug #15304 - Tooltip does not hide on multiSelect clear
  • Loading branch information
cetincakiroglu authored Apr 26, 2024
2 parents 647b1d5 + 59aab7e commit 2ffcb2e
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 2ffcb2e

Please sign in to comment.