Skip to content

Commit

Permalink
Fixed #10170 - p-dropdown with editable=true and floating labels resu…
Browse files Browse the repository at this point in the history
…lts in incorrect behavior with manually entered values
  • Loading branch information
yigitfindikli committed Apr 28, 2021
1 parent 1ca34ef commit d07b4a3
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions src/app/components/dropdown/dropdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ export class DropdownItem {
])
],
host: {
'[class.p-inputwrapper-filled]': 'filled',
'[class.p-inputwrapper-filled]': 'value',
'[class.p-inputwrapper-focus]': 'focused || overlayVisible'
},
providers: [DROPDOWN_VALUE_ACCESSOR],
Expand Down Expand Up @@ -322,8 +322,6 @@ export class Dropdown implements OnInit,AfterViewInit,AfterContentInit,AfterView

focused: boolean;

filled: boolean;

overlayVisible: boolean;

documentClickListener: any;
Expand Down Expand Up @@ -412,7 +410,6 @@ export class Dropdown implements OnInit,AfterViewInit,AfterContentInit,AfterView
this.optionsToDisplay = this._options;
this.updateSelectedOption(this.value);
this.optionsChanged = true;
this.updateFilledState();

if (this._filterValue && this._filterValue.length) {
this.activateFilter();
Expand Down Expand Up @@ -481,7 +478,6 @@ export class Dropdown implements OnInit,AfterViewInit,AfterContentInit,AfterView
if (this.selectedOption != option) {
this.selectedOption = option;
this.value = this.getOptionValue(option);
this.filled = true;

this.onModelChange(this.value);
this.updateEditableLabel();
Expand Down Expand Up @@ -539,7 +535,6 @@ export class Dropdown implements OnInit,AfterViewInit,AfterContentInit,AfterView
this.value = value;
this.updateSelectedOption(value);
this.updateEditableLabel();
this.updateFilledState();
this.cd.markForCheck();
}

Expand Down Expand Up @@ -1167,10 +1162,6 @@ export class Dropdown implements OnInit,AfterViewInit,AfterContentInit,AfterView
}
}

updateFilledState() {
this.filled = (this.selectedOption != null);
}

clear(event: Event) {
this.value = null;
this.onModelChange(this.value);
Expand All @@ -1180,7 +1171,6 @@ export class Dropdown implements OnInit,AfterViewInit,AfterContentInit,AfterView
});
this.updateSelectedOption(this.value);
this.updateEditableLabel();
this.updateFilledState();
}

onOverlayHide() {
Expand Down

0 comments on commit d07b4a3

Please sign in to comment.