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

Improve behavior of the viewport scroll after selection change #10709

Merged
merged 20 commits into from Jan 18, 2024

Conversation

budnix
Copy link
Member

@budnix budnix commented Jan 9, 2024

Context

The PR improves the viewport scroll's behavior after the selection change triggered by the mouse clicks. Additionally, the PR improves/fixes other things related to the viewport scroll behavior. The PR modularizes the viewport scrolling mechanism into a separate module that handles all scroll-related things.

The PR's changes:

Features

  1. The viewport won't be scrolled after clicking the partially visible cell. The rule only applies in cases when the visible beginning of the cell is clicked (the cell is partially visible on the right edge of the table). When the end of the partially visible cell is clicked, the viewport is scrolled to the whole cell.

Bug fixes

  1. Fixed a bug that causes the viewport to scroll in the wrong direction. It happens only after applying the selection for the first time (after table initialization).

Clicking on the beginning part of the partially visible cell (feature)

The same logic covers both axies, partially visible columns, and rows.

Before

Kapture 2024-01-10 at 15 19 14

After

Kapture 2024-01-10 at 15 19 36

Clicking on the end part of the partially visible cell (feature)

As before, so, and after the PR's changes, the behavior is the same. The viewport is scrolled to the beginning of the cell.
Kapture 2024-01-10 at 15 21 45

How has this been tested?

I tested the changes locally and I covered the feature with new tests.

Types of changes

  • New feature or improvement (non-breaking change which adds functionality)

Related issue(s):

  1. https://github.com/handsontable/dev-handsontable/issues/1689
  2. https://github.com/handsontable/dev-handsontable/issues/1705

Affected project(s):

  • handsontable

Checklist:

@budnix budnix self-assigned this Jan 9, 2024
Copy link

github-actions bot commented Jan 9, 2024

Launch the local version of documentation by running:

npm run docs:review 6d89addac04ccae23d9ed5412df931fa45d31237

@budnix budnix marked this pull request as ready for review January 15, 2024 13:31
@budnix budnix requested a review from jansiegel January 15, 2024 13:31
@budnix budnix changed the title [wip] Improve behavior of the viewport scroll after a cell click Improve behavior of the viewport scroll after a cell click Jan 15, 2024
@budnix budnix changed the title Improve behavior of the viewport scroll after a cell click Improve behavior of the viewport scroll after selection change Jan 15, 2024
@budnix budnix merged commit 40cdda4 into develop Jan 18, 2024
21 checks passed
@budnix budnix deleted the feature/dev-issue-1689 branch January 18, 2024 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants