RED-9513 - Enter Key Not Working: Unable to Add Terms to Dictionary
This commit is contained in:
parent
ce334dbdeb
commit
01c244aa07
@ -1,5 +1,5 @@
|
||||
<button
|
||||
(click)="!disabled() && action.emit($event)"
|
||||
(click)="!disabled() && emitAction($event)"
|
||||
[disabled]="disabled()"
|
||||
[id]="buttonId()"
|
||||
[iqserStopPropagation]="action.observed && !_hasRouterLink"
|
||||
|
||||
@ -1,15 +1,5 @@
|
||||
import { NgClass } from '@angular/common';
|
||||
import {
|
||||
booleanAttribute,
|
||||
ChangeDetectionStrategy,
|
||||
Component,
|
||||
computed,
|
||||
EventEmitter,
|
||||
HostListener,
|
||||
inject,
|
||||
input,
|
||||
Output,
|
||||
} from '@angular/core';
|
||||
import { booleanAttribute, ChangeDetectionStrategy, Component, computed, EventEmitter, inject, input, Output } from '@angular/core';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
import { RouterLink } from '@angular/router';
|
||||
@ -44,9 +34,10 @@ export class IconButtonComponent {
|
||||
});
|
||||
@Output() readonly action = new EventEmitter<MouseEvent>();
|
||||
|
||||
@HostListener('window:keydown.Enter', ['$event'])
|
||||
preventEnterKey($event: KeyboardEvent) {
|
||||
$event?.preventDefault();
|
||||
$event?.stopPropagation();
|
||||
emitAction($event: MouseEvent) {
|
||||
const activeElement = document.activeElement as HTMLElement;
|
||||
if (activeElement.tagName?.toLowerCase() === 'button') {
|
||||
this.action.emit($event);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user