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

[8.0.0-beta.2-rev13] Selecting a partially-hidden merged cell gives it a wrong color overlay. #7010

Closed
jansiegel opened this issue Jun 15, 2020 · 2 comments
Assignees
Labels
bug Core: Selection Plugin Merge cells Plugin Regression Issues that were created while adding new changes to the source code

Comments

@jansiegel
Copy link
Member

Description

When selecting a partially-hidden merged cell, it gets a blue overlay, and it shouldn't.

Works fine until rev13.

Steps to reproduce

  1. Go to https://jsfiddle.net/js_ziggle/x29rhkgt/
  2. Select the merged cell at (1, 1)

Demo

https://jsfiddle.net/js_ziggle/x29rhkgt/

@wszymanski wszymanski self-assigned this Jun 15, 2020
@AMBudnik AMBudnik added Core: Selection Plugin Merge cells Plugin Regression Issues that were created while adding new changes to the source code bug labels Jun 15, 2020
@wszymanski
Copy link
Contributor

wszymanski commented Jun 15, 2020

The below test hasn't guaranteed proper work of the case as we can see.

it('should select single merged area properly when it starts with hidden column', () => {
handsontable({
data: Handsontable.helper.createSpreadsheetData(5, 5),
rowHeaders: true,
colHeaders: true,
contextMenu: true,
hiddenColumns: {
columns: [1],
indicators: true
},
mergeCells: [{ row: 1, col: 1, rowspan: 3, colspan: 3 }]
});
const mergedCell = spec().$container.find('tr:eq(2) td:eq(1)');
simulateClick(mergedCell);
// Third column is not displayed (CSS - display: none).
expect(`
| ║ : - : - : |
|===:===:===:===:===|
| ║ : : : |
| - ║ : # : : |
| - ║ : : : |
| - ║ : : : |
| ║ : : : |
`).toBeMatchToSelectionPattern();
expect(getSelected()).toEqual([[1, 1, 3, 3]]);
expect(getSelectedRangeLast().highlight.row).toBe(1);
expect(getSelectedRangeLast().highlight.col).toBe(2);
expect(getSelectedRangeLast().from.row).toBe(1);
expect(getSelectedRangeLast().from.col).toBe(1);
expect(getSelectedRangeLast().to.row).toBe(3);
expect(getSelectedRangeLast().to.col).toBe(3);
expect($(mergedCell).hasClass('fullySelectedMergedCell')).toBeFalse();
expect($(mergedCell).hasClass('fullySelectedMergedCell-multiple')).toBeFalse();
expect($(mergedCell).hasClass('fullySelectedMergedCell-0')).toBeFalse();
expect($(mergedCell).hasClass('fullySelectedMergedCell-1')).toBeFalse();
expect($(mergedCell).hasClass('fullySelectedMergedCell-2')).toBeFalse();
expect($(mergedCell).hasClass('fullySelectedMergedCell-3')).toBeFalse();
expect($(mergedCell).hasClass('fullySelectedMergedCell-4')).toBeFalse();
expect($(mergedCell).hasClass('fullySelectedMergedCell-5')).toBeFalse();
expect($(mergedCell).hasClass('fullySelectedMergedCell-6')).toBeFalse();
expect($(mergedCell).hasClass('fullySelectedMergedCell-7')).toBeFalse();
});

I will investigate.

Edit: Situation with rows is even stranger. The table with some configuration (take a look at the below test) doesn't look properly.

it('should select single merged area properly when it starts with hidden row', () => {
handsontable({
data: Handsontable.helper.createSpreadsheetData(5, 5),
rowHeaders: true,
colHeaders: true,
contextMenu: true,
hiddenRows: {
rows: [1],
indicators: true
},
mergeCells: [{ row: 1, col: 1, rowspan: 3, colspan: 3 }]
});
const mergedCell = spec().$container.find('tr:eq(2) td:eq(1)');
simulateClick(mergedCell);
// Third row is not displayed (CSS - display: none).
expect(`
| ║ : - : - : - : |
|===:===:===:===:===:===|
| ║ : : : : |
| - ║ : # : : : |
| - ║ : : : : |
| ║ : : : : |
`).toBeMatchToSelectionPattern();
expect(getSelected()).toEqual([[1, 1, 3, 3]]);
expect(getSelectedRangeLast().highlight.row).toBe(2);
expect(getSelectedRangeLast().highlight.col).toBe(1);
expect(getSelectedRangeLast().from.row).toBe(1);
expect(getSelectedRangeLast().from.col).toBe(1);
expect(getSelectedRangeLast().to.row).toBe(3);
expect(getSelectedRangeLast().to.col).toBe(3);
expect($(mergedCell).hasClass('fullySelectedMergedCell')).toBeFalse();
expect($(mergedCell).hasClass('fullySelectedMergedCell-multiple')).toBeFalse();
expect($(mergedCell).hasClass('fullySelectedMergedCell-0')).toBeFalse();
expect($(mergedCell).hasClass('fullySelectedMergedCell-1')).toBeFalse();
expect($(mergedCell).hasClass('fullySelectedMergedCell-2')).toBeFalse();
expect($(mergedCell).hasClass('fullySelectedMergedCell-3')).toBeFalse();
expect($(mergedCell).hasClass('fullySelectedMergedCell-4')).toBeFalse();
expect($(mergedCell).hasClass('fullySelectedMergedCell-5')).toBeFalse();
expect($(mergedCell).hasClass('fullySelectedMergedCell-6')).toBeFalse();
expect($(mergedCell).hasClass('fullySelectedMergedCell-7')).toBeFalse();
});

@aninde
Copy link
Contributor

aninde commented Jun 30, 2020

This issue is solved by 8.0.0-beta2-rev18 https://jsfiddle.net/aninde/xmotLk3u/
Screenshot 2020-06-30 at 14 44 46

@aninde aninde closed this as completed Jun 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Core: Selection Plugin Merge cells Plugin Regression Issues that were created while adding new changes to the source code
Projects
None yet
Development

No branches or pull requests

4 participants