igniteui-angular icon indicating copy to clipboard operation
igniteui-angular copied to clipboard

navigateTo method does not scroll vertically when both row index and column index are passed as parameters

Open ymita opened this issue 7 years ago • 2 comments

Description

navigateTo method does not scroll grid vertically when both row index and column index are provided.

  • igniteui-angular version: 8.2.0
  • browser: n/a

Steps to reproduce

  1. Run the attached sample
  2. Click "Go to middle of the grid" button

Result

navigateTo(11, 15) is called however vertical scroll is not triggered.

Expected result

navigateTo(11, 15) is called so that the grid scroll to show the 11th row in viewport.

Attachments

Attach a sample if available, and screenshots, if applicable.
igx-grid-scroll-position.zip

Note

If performVerticalScrollToCell() is called at the end of navigateTo method, the grid works as expected.

    public navigateTo(rowIndex: number, visibleColIndex = -1, cb: Function = null) {
        if (rowIndex < 0 || rowIndex > this.verticalScrollContainer.igxForOf.length - 1
            || (visibleColIndex !== -1 && this.columnList.map(col => col.visibleIndex).indexOf(visibleColIndex) === -1)) {
            return;
        }
        this.wheelHandler();
        if (this.verticalScrollContainer.igxForOf.slice(rowIndex, rowIndex + 1).find(rec => rec.expression || rec.childGridsData)) {
            visibleColIndex = -1;
        }
        if (visibleColIndex === -1 || this.navigation.isColumnFullyVisible(visibleColIndex)) {
            if (this.navigation.shouldPerformVerticalScroll(rowIndex, visibleColIndex)) {
                this.navigation.performVerticalScrollToCell(rowIndex, visibleColIndex,
                    () => { this.executeCallback(rowIndex, visibleColIndex, cb); });
            } else {
                this.executeCallback(rowIndex, visibleColIndex, cb);
            }
        } else {
            this.navigation.performHorizontalScrollToCell(rowIndex, visibleColIndex, false,
                () => { this.executeCallback(rowIndex, visibleColIndex, cb); });
            // add the following
            this.navigation.performVerticalScrollToCell(rowIndex, visibleColIndex,
                () => { this.executeCallback(rowIndex, visibleColIndex, cb); });
        }
    }

ymita avatar Oct 01 '19 04:10 ymita

Hi @wnvko and @ddincheva, Can you possibly fix this in 7.x along with 8.x please?

ymita avatar Oct 03 '19 01:10 ymita

Assigning @radomirchev as well

zdrawku avatar Oct 03 '19 12:10 zdrawku