Skip to content

Commit

Permalink
implementation(PrimeNG-17): #29664 Fix p-dropdown issues and breaking…
Browse files Browse the repository at this point in the history
… change (#29704)

### Proposed Changes
* remove attr `autoDisplayFirst ` since will be deprecated; we have
placeholders on all the cases actually don't make any difference based
on the description: `Whether to display the first item as the label if
no placeholder is defined and value is null.`
* adding styles to remove the outline in the dropdown label /
placeholder.


### Screenshots

Before

<img width="382" alt="image"
src="https://github.com/user-attachments/assets/b0bdaeee-b6a8-4f0a-9dff-7127bbaf7086">



After 

<img width="379" alt="image"
src="https://github.com/user-attachments/assets/216d8416-1d9a-4276-8395-b1ef453b3eb8">
  • Loading branch information
hmoreras authored Aug 22, 2024
1 parent 9a3b696 commit 2a489ee
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@
[options]="dateVarOptions"
[tabindex]="7"
[placeholder]="'contenttypes.form.date.field.placeholder' | dm"
[autoDisplayFirst]="false"
[showClear]="true"
id="content-type-form-publish-date-field"
appendTo="body"
Expand All @@ -111,7 +110,6 @@
<p-dropdown
(onChange)="handleDateVarChange($event, 'expireDateVar')"
[showClear]="true"
[autoDisplayFirst]="false"
[options]="dateVarOptions"
[tabindex]="8"
[placeholder]="'contenttypes.form.date.field.placeholder' | dm"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
*ngIf="actions$ | async as actions"
(onChange)="handleChange($event)"
[(ngModel)]="value"
[autoDisplayFirst]="false"
[disabled]="disabled || actions.length === 0"
[group]="true"
[options]="actions"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ describe('DotWorkflowsActionsSelectorFieldComponent', () => {
expect(dropdown.group).toBe(true);
expect(dropdown.placeholder).toBe('Select an action');
expect(dropdown.style).toEqual({ width: '100%' });
expect(dropdown.autoDisplayFirst).toBe(false);
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ p-dropdown.ng-dirty.ng-invalid > .p-dropdown {
.p-dropdown-label {
padding-right: $spacing-1;
@include truncate-text;

&:focus,
&:enabled:focus {
outline: 0 none;
box-shadow: none;
}
}

&:has(.p-dropdown-clear-icon) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
[filter]="true"
[placeholder]="dropdownLabel"
[formControl]="formControl"
[autoDisplayFirst]="false"
scrollHeight="18.75rem"
dotContainerOptions
data-testId="btn-plus"
Expand Down

0 comments on commit 2a489ee

Please sign in to comment.