Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6316,6 +6316,9 @@ export abstract class IgxGridBaseDirective implements GridType,
// TODO: do not remove this, as it is used in rowEditTemplate, but mark is as internal and hidden
/* blazorCSSuppress */
public endEdit(commit = true, event?: Event): boolean {
if (!this.crudService.cellInEditMode && !this.crudService.rowInEditMode) {
return;
}
const document = this.nativeElement?.getRootNode() as Document | ShadowRoot;
const focusWithin = this.nativeElement?.contains(document.activeElement);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ describe('IgxGrid - Cell selection #grid', () => {

UIInteractions.simulatePointerOverElementEvent('pointerup', endCell.nativeElement);
detect();
// Invoke endEdit() to make sure if no editing is going on,
// the cell activation shouldn't be lost (https://infragistics.visualstudio.com/Indigo_Platform/_workitems/edit/37933)
grid.endEdit(true, null);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO it would be better if this was a separate test rather than modifying an existing basic one. If we automate everything related to a certain feature in the same test it will soon become too convoluted to read and maintain.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that's true, but it's a single line and we are at a stage were we have too many test and we should be careful when adding new ones, also Damyan suggested adding this to an already existing one.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you elaborate on what you mean by too many tests? I'm not aware of there being an issue with adding new ones.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mainly because of the disconnects, I know there is another reason for them, but the bigger amount of the tests is not helping.

fix.detectChanges();

expect(startCell.active).toBe(true);
GridSelectionFunctions.verifyCellsRegionSelected(grid, 2, 3, 1, 0);
Expand Down
Loading