Skip to content

Commit 79c6b39

Browse files
committed
Revert "[ACS-10324]: checkbox enter key handling (#11271)"
This reverts commit 6ab54be.
1 parent 3e1067f commit 79c6b39

File tree

2 files changed

+1
-30
lines changed

2 files changed

+1
-30
lines changed

lib/core/src/lib/datatable/components/datatable/datatable.component.html

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -253,9 +253,7 @@
253253
[aria-label]="'ADF-DATATABLE.ACCESSIBILITY.SELECT_FILE' | translate"
254254
data-adf-datatable-row-checkbox
255255
(change)="onCheckboxChange(row, $event)"
256-
(keydown.enter)="$event.stopPropagation()"
257-
class="adf-checkbox-sr-only"
258-
>
256+
class="adf-checkbox-sr-only">
259257
{{ 'ADF-DATATABLE.ACCESSIBILITY.SELECT_FILE' | translate }}
260258
</mat-checkbox>
261259
</label>

lib/core/src/lib/datatable/components/datatable/datatable.component.spec.ts

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1395,33 +1395,6 @@ describe('DataTable', () => {
13951395
expect(rows[1].isSelected).toBeTrue();
13961396
});
13971397

1398-
it('should call stopPropagation on checkbox keydown enter event', () => {
1399-
const petRows = [{ pet: 'dog' }, { pet: 'cat' }];
1400-
dataTable.multiselect = true;
1401-
dataTable.data = new ObjectDataTableAdapter(petRows, [new ObjectDataColumn({ key: 'pet' })]);
1402-
dataTable.ngOnChanges({ rows: new SimpleChange(null, petRows, false) });
1403-
fixture.detectChanges();
1404-
1405-
const checkboxElement = testingUtils.getByCSS('[data-adf-datatable-row-checkbox]').nativeElement as HTMLElement;
1406-
1407-
const enterEvent = new KeyboardEvent('keydown', {
1408-
key: 'Enter',
1409-
code: 'Enter',
1410-
bubbles: true,
1411-
cancelable: true
1412-
});
1413-
1414-
const stopPropagationSpy = jasmine.createSpy('stopPropagationSpy');
1415-
1416-
Object.assign(enterEvent, {
1417-
stopPropagation: stopPropagationSpy
1418-
});
1419-
1420-
checkboxElement.dispatchEvent(enterEvent);
1421-
1422-
expect(stopPropagationSpy).toHaveBeenCalled();
1423-
});
1424-
14251398
it('should be able to display column of type boolean', () => {
14261399
dataTable.data = new ObjectDataTableAdapter(mockCarsData, mockCarsSchemaDefinition);
14271400

0 commit comments

Comments
 (0)