Skip to content

Commit

Permalink
fix(search): fix converting nodeLists to array #3637
Browse files Browse the repository at this point in the history
  • Loading branch information
DiyanDimitrov committed Jan 17, 2019
1 parent faa8586 commit 39a48be
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -318,15 +318,15 @@ export class IgxTextHighlightDirective implements AfterViewInit, OnDestroy, OnCh
if (this._observer === null) {
const callback = (mutationList) => {
mutationList.forEach((mutation) => {
const removedNodes = new Array(... mutation.removedNodes);
const removedNodes = Array.from(mutation.removedNodes);
removedNodes.forEach((n) => {
if (n === this._container) {
this._nodeWasRemoved = true;
this.clearChildElements(false);
}
});

const addedNodes = new Array(... mutation.addedNodes);
const addedNodes = Array.from(mutation.addedNodes);
addedNodes.forEach((n) => {
if (n === this.parentElement.firstElementChild && this._nodeWasRemoved) {
this._container = this.parentElement.firstElementChild;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -714,8 +714,7 @@ describe('IgxGrid - search API', () => {
expect(isInView(3, grid.rowList.first.virtDirRow.state)).toBeTruthy();
});

fit('should keep the active highlight when active cell enters and exits edit mode', async () => {
// pending('When the cell enters edit mode, the highlight stays and the content is doubled! Happens in tests only!');
it('should keep the active highlight when active cell enters and exits edit mode', async () => {
const rv = fix.debugElement.query(By.css(CELL_CSS_CLASS)).nativeElement;
const cell = grid.getCellByColumn(0, 'ID');
const initialValue = rv.textContent;
Expand All @@ -732,7 +731,6 @@ describe('IgxGrid - search API', () => {
expect(activeHighlight).not.toBeNull();

cell.inEditMode = true;
// fix.detectChanges();
await wait(16);
fix.detectChanges();

Expand All @@ -750,9 +748,7 @@ describe('IgxGrid - search API', () => {
expect(activeHighlight).not.toBeNull();
});

fit('should update highlights when a new value is entered', async () => {
// pending('When the cell enters edit mode, the highlight stays and the content is doubled! Happens in tests only!');

it('should update highlights when a new value is entered', async () => {
const rv = fix.debugElement.query(By.css(CELL_CSS_CLASS));
const cell = grid.getCellByColumn(0, 'ID');
cell.column.editable = true;
Expand Down

0 comments on commit 39a48be

Please sign in to comment.