Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
ymita opened this issue Oct 1, 2019 · 2 comments · Fixed by #5976
Assignees
Labels
🐛 bug Any issue that describes a bug 🧨 severity: medium grid: general version: 8.2.x virtualization ✅ status: resolved Applies to issues that have pending PRs resolving them, or PRs that have already merged.

Comments

@ymita
Copy link
Contributor

ymita commented Oct 1, 2019

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 ymita added 🐛 bug Any issue that describes a bug grid: general labels Oct 1, 2019
@ymita
Copy link
Contributor Author

ymita commented Oct 3, 2019

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

@zdrawku zdrawku assigned zdrawku and radomirchev and unassigned ddincheva Oct 3, 2019
@zdrawku
Copy link
Contributor

zdrawku commented Oct 3, 2019

Assigning @radomirchev as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Any issue that describes a bug 🧨 severity: medium grid: general version: 8.2.x virtualization ✅ status: resolved Applies to issues that have pending PRs resolving them, or PRs that have already merged.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants