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

We're not able to align cells if the selection is made upward #6600

Closed
AMBudnik opened this issue Jan 7, 2020 · 3 comments
Closed

We're not able to align cells if the selection is made upward #6600

AMBudnik opened this issue Jan 7, 2020 · 3 comments

Comments

@AMBudnik
Copy link
Contributor

AMBudnik commented Jan 7, 2020

Description

We're not able to align cells if the selection is made upward.

Steps to reproduce

  1. Select cells B3:A1
  2. Open context menu
  3. Pick Center

down

Result
Nothin happens, the menu is closed.

Now:

  1. Select cells A1:B3
  2. Open context menu
  3. Pick Center

up

Result
Cells are aligned center, the menu is closed.

Demo

https://jsfiddle.net/qwyue5o6/ 7.3.0

Your environment

  • Handsontable version: 7.3.0
    It doesn't seem to be related to any version.
  • Browser Name and version: Chrome 79
  • Operating System: Windows 10
@AMBudnik
Copy link
Contributor Author

The issue is still replicable in v 8.0.0-beta1 https://jsfiddle.net/AMBudnik/zj7vabqf/

budnix added a commit that referenced this issue Jun 19, 2020
While fixing the negative coordinates I've spotted that alignment and
comments command from context menu doesn't work when the selection was
made in different direction that top-left to bottom-right.

Issue: #6998, #6600
budnix added a commit that referenced this issue Jun 30, 2020
* Revert headers selection when all indexes are trimmed

The header selection is restored by passing through the negative values
through the whole library. This braking change forced all tests to be
adjusted.

Issue: #6998

* Separate coordinates context between WoT and HoT

In this commit I separate how the coordinates are used within
Walkontable and Handsontable context. The Walkontable renderer needs to
know about negative coordinates as that module render the whole table.
In The Handsontable context, however only coordinates for cells are
important mostly. As in that context exists cell meta objects which
exists only for cells.

Issue: #6998

* Change getHight and getWidth methods

Change methods in the same manner as was done for "getTopLeftCorner",
"getOuterTopLeftCorner" and similar methods.

Issue: #6998

* Fix getHight, getWidth for selection

Issue: #6998

* Fix alignment and comments ops from context menu

While fixing the negative coordinates I've spotted that alignment and
comments command from context menu doesn't work when the selection was
made in different direction that top-left to bottom-right.

Issue: #6998, #6600

* Fix issues revealed after changing selection methods

Adjust the logic how the selection was processed by the plugins. I
removed all references to negative indexes.

Issue: #6998

* Fix Border context menu command

Add condition for retrieving only cell coordinates (ignoring header)

Issue: #6998

* Fix wrong assumption

The indexes equal to 0 are wrongly excluded from the borders logic.

Issue: #6998

* Fix undoing merge cells and alignment operations

When the header was selected and merged cells or alignment
operations were undoing, an exception was thrown. This was caused
by negative coordinates. I fixed this by excluding negative
coordinates from the process.

Issue: #6998

* Fix eslint complains

Split long line.

Issue: #6998

* Add tests for merge cells and alignment ops

Issue: #6998

* Fix unresponsive AutoFill handler

When the row or column header was selected the AutoFill handler was
unresponsive on filling action. This is caused by negative coordinates.
I fixed this by coords normalization.

Issue: #6998

* Fix selection after autofill operation

Issue: #6998

* Fix eslint complains

Issue: #6998

* Fix editor positioning

When row or column header was selected and enter was hit then the editor
position was out of sync by 1px relative to the cell. I've corrected the
condition in the editors code which includes 1px only for row and column
equals to 0.

Issue: #6998

* Make the logic for showColumn more consistent

Consistent with the counterpart file (showRow.js)

Issue: #6998

* Update src/editors/textEditor.js

Co-authored-by: Wojciech Szymański <141330+wszymanski@users.noreply.github.com>

* Update src/plugins/comments/test/comments.e2e.js

Co-authored-by: Wojciech Szymański <141330+wszymanski@users.noreply.github.com>

* Add ability to clone CellRange instance

Issue: #6998

* Fix unselectable headers when all indexes are hidden

The header selection generally contains cell selection coordinates. In a
case when all rows (or columns) are hidden that visual coordinates are
translated to renderable coordinates that do not exist. Hence no header
highlight is generated. In that case, to make a column (or a row) header
highlight, the row and column index has point to the header (the
negative value).

Issue: #7051

* Add ability to highlight headers for hidden indexes

Add ability to highlight headers (gray color) when one of the indexes
(row or column) are hidden and the second index is visible.

To support header highlight for that cases the `getCorner` method of the
Selection class is overwritten. There are two approaches to convince the
header Selection to highlight specific headers. One overwrite the method
which controls coordinates for headers (chosen approach for this commit)
and second rewrite/adjust CellCoords, CellRange, and correct all methods
that deal with numbers to support `null` values - to match changes.

Issue: #7051

* Improve code readability

Issue: #7051

* Change method name

Issue: #7051

Co-authored-by: Wojciech Szymański <141330+wszymanski@users.noreply.github.com>

Co-authored-by: Wojciech Szymański <141330+wszymanski@users.noreply.github.com>
@AMBudnik
Copy link
Contributor Author

Well done @budnix another issue solved for v8.

cool

https://jsfiddle.net/8wpt59bj/
Tested on Chrome 83 / macOS Catalina with Handsontable v 8.0.0-beta2-rev18

@wojciechczerniak wojciechczerniak mentioned this issue Jun 30, 2020
204 tasks
@AMBudnik
Copy link
Contributor Author

AMBudnik commented Aug 6, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant