@ngx-smz/ui-kit 21.10.0-next.17 → 21.10.0-next.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4289,7 +4289,15 @@ class SmzListboxComponent extends SmzValueAccessor {
4289
4289
  this.clicked.emit({ originalEvent: event, option, value });
4290
4290
  this.touch();
4291
4291
  }
4292
+ onItemEnter(option, event) {
4293
+ // Teclas vindas de conteudo projetado no item (inputs, botoes) pertencem a esse conteudo.
4294
+ if (event.target !== event.currentTarget)
4295
+ return;
4296
+ this.onItemClick(option, event);
4297
+ }
4292
4298
  focusSibling(event, step) {
4299
+ if (event.target !== event.currentTarget)
4300
+ return;
4293
4301
  event.preventDefault();
4294
4302
  const row = event.currentTarget;
4295
4303
  const sibling = (step === 1 ? row.nextElementSibling : row.previousElementSibling);
@@ -4315,7 +4323,7 @@ class SmzListboxComponent extends SmzValueAccessor {
4315
4323
  [attr.tabindex]="index === 0 ? 0 : -1"
4316
4324
  [class]="rowClass(option)"
4317
4325
  (click)="onItemClick(option, $event)"
4318
- (keydown.enter)="onItemClick(option, $event)"
4326
+ (keydown.enter)="onItemEnter(option, $event)"
4319
4327
  (keydown.arrowdown)="focusSibling($event, 1)"
4320
4328
  (keydown.arrowup)="focusSibling($event, -1)"
4321
4329
  >
@@ -4379,7 +4387,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.5", ngImpor
4379
4387
  [attr.tabindex]="index === 0 ? 0 : -1"
4380
4388
  [class]="rowClass(option)"
4381
4389
  (click)="onItemClick(option, $event)"
4382
- (keydown.enter)="onItemClick(option, $event)"
4390
+ (keydown.enter)="onItemEnter(option, $event)"
4383
4391
  (keydown.arrowdown)="focusSibling($event, 1)"
4384
4392
  (keydown.arrowup)="focusSibling($event, -1)"
4385
4393
  >