Skip to content

Commit d82a6dc

Browse files
jhonyeduardosamir-ayoub
authored andcommitted
fix(multiselect): corrige comportamento do componente no IE
No IE caso infomar `p-options` com valores muito grandes, não era possível abrir o mesmo. A propriedade value da tag li não deveria ser utilizada quando a mesma estiver abaixo da tag ul, causando problemas no IE. Fixes DTHFUI-1857
1 parent 015f617 commit d82a6dc

File tree

4 files changed

+8
-13
lines changed

4 files changed

+8
-13
lines changed

projects/ui/src/lib/components/po-field/po-multiselect/po-multiselect-dropdown/po-multiselect-dropdown.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
</div>
1414

1515
<po-multiselect-item *ngFor="let option of options"
16-
[p-option]="option"
16+
[p-label]="option.label"
1717
[p-selected]="isSelectedItem(option)"
1818
(p-change)="clickItem($event, option)">
1919
</po-multiselect-item>
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
<li [value]="option?.value"
2-
(click)="itemClicked()"
3-
[class.po-multiselect-item-selected]="selected">
1+
<li [class.po-multiselect-item-selected]="selected" (click)="itemClicked()">
42

53
<a class="po-multiselect-item">
64
<input
@@ -10,7 +8,7 @@
108
type="checkbox">
119

1210
<label class="po-multiselect-checkbox-label po-clickable">
13-
{{ option?.label }}
11+
{{ label }}
1412
</label>
1513
</a>
1614
</li>

projects/ui/src/lib/components/po-field/po-multiselect/po-multiselect-item/po-multiselect-item.component.spec.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ describe('PoMultiselectItemComponent', () => {
1717
beforeEach(() => {
1818
fixture = TestBed.createComponent(PoMultiselectItemComponent);
1919
component = fixture.componentInstance;
20-
21-
fixture.detectChanges();
2220
});
2321

2422
it('should be created', () => {

projects/ui/src/lib/components/po-field/po-multiselect/po-multiselect-item/po-multiselect-item.component.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
import { Component, EventEmitter, Input, Output } from '@angular/core';
2-
3-
import { PoMultiselectOption } from './../po-multiselect-option.interface';
1+
import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core';
42

53
/**
64
* @docsPrivate
@@ -11,12 +9,13 @@ import { PoMultiselectOption } from './../po-multiselect-option.interface';
119
*/
1210
@Component({
1311
selector: 'po-multiselect-item',
14-
templateUrl: './po-multiselect-item.component.html'
12+
templateUrl: './po-multiselect-item.component.html',
13+
changeDetection: ChangeDetectionStrategy.OnPush
1514
})
1615
export class PoMultiselectItemComponent {
1716

18-
/** Opção que irá gerar o item, implementando a interface PoMultiselectOption. */
19-
@Input('p-option') option: PoMultiselectOption = null;
17+
/** Rótulo do item. */
18+
@Input('p-label') label: string;
2019

2120
/** Esta propriedade indica se o campo está selecionado ou não. */
2221
@Input('p-selected') selected?: boolean = false;

0 commit comments

Comments
 (0)