mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-5517] Reverted extra bug fixes changes (#8605)
* ADF-5517 Reverted extra bug fixes changes * ADF-5517 Reverted extra bug fixes changes
This commit is contained in:
@@ -166,7 +166,6 @@
|
||||
(select)="onEnterKeyPressed(row, $event)"
|
||||
(keyup)="onRowKeyUp(row, $event)"
|
||||
(keydown)="onRowEnterKeyDown(row, $event)"
|
||||
(click)="onRowClick(row, $event)"
|
||||
[adf-upload]="rowAllowsDrop(row)"
|
||||
[adf-upload-data]="row"
|
||||
[ngStyle]="rowStyle"
|
||||
@@ -210,7 +209,7 @@
|
||||
[attr.data-automation-id]="getAutomationValue(row)"
|
||||
[attr.aria-selected]="row.isSelected ? true : false"
|
||||
[attr.aria-label]="col.title ? (col.title | translate) : null"
|
||||
(click)="storeActiveRow(row)"
|
||||
(click)="onRowClick(row, $event)"
|
||||
(keydown.enter)="onEnterKeyPressed(row, $any($event))"
|
||||
[adf-context-menu]="getContextMenuActions(row, col)"
|
||||
[adf-context-menu-enabled]="contextMenu"
|
||||
|
@@ -1352,7 +1352,7 @@ describe('DataTable', () => {
|
||||
|
||||
dataTable.resetSelection();
|
||||
const rowClickPromise = dataTable.rowClick.pipe(take(1)).toPromise();
|
||||
const rowElement = fixture.debugElement.query(By.css(`[data-automation-id="datatable-row-0"]`)).nativeElement as HTMLElement;
|
||||
const rowElement = fixture.debugElement.query(By.css(`[data-automation-id="datatable-row-0"] > div`)).nativeElement as HTMLElement;
|
||||
rowElement.dispatchEvent(new MouseEvent('click'));
|
||||
fixture.detectChanges();
|
||||
await rowClickPromise;
|
||||
|
@@ -501,24 +501,16 @@ export class DataTableComponent implements OnInit, AfterContentInit, OnChanges,
|
||||
}
|
||||
|
||||
onRowClick(row: DataRow, mouseEvent: MouseEvent) {
|
||||
if (!mouseEvent.composedPath().some(
|
||||
(element: HTMLElement) => element.id?.startsWith('action_menu_right_') || element.classList?.contains('adf-checkbox-sr-only'))
|
||||
) {
|
||||
if (mouseEvent) {
|
||||
mouseEvent.preventDefault();
|
||||
}
|
||||
|
||||
if (row) {
|
||||
const dataRowEvent = new DataRowEvent(row, mouseEvent, this);
|
||||
this.clickObserver.next(dataRowEvent);
|
||||
}
|
||||
if (mouseEvent) {
|
||||
mouseEvent.preventDefault();
|
||||
}
|
||||
}
|
||||
|
||||
storeActiveRow(row: DataRow) {
|
||||
if (row) {
|
||||
const rowIndex = this.data.getRows().indexOf(row) + (this.isHeaderListVisible() ? 1 : 0);
|
||||
this.keyManager.setActiveItem(rowIndex);
|
||||
|
||||
const dataRowEvent = new DataRowEvent(row, mouseEvent, this);
|
||||
this.clickObserver.next(dataRowEvent);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user