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

[0.36.0+] When minSpareCols is set to 1, using Tab key to create new columns deletes data from previous columns #4986

Closed
paolostyle opened this issue Mar 31, 2018 · 2 comments
Assignees
Labels
bug Core: Spare rows/columns Plugin Regression Issues that were created while adding new changes to the source code Status: Released
Milestone

Comments

@paolostyle
Copy link

I can't quite explain it, hence the rather bad title, so steps to reproduce:

  1. https://jsfiddle.net/ws4acu4n/ - minSpareCols: 1 is the most relevant option
  2. Go to any cell in F column, say F1
  3. Type anything, press Tab
  4. You'll be in G1, do the same thing - type anything and press Tab
  5. You'll be in H1, do the same thing again - type whatever and press Tab
  6. The G1 cell is now empty when, obviously, it should not be.

If you do that a few more times (type anything and press tab to create new column) you'll notice only the last typed value is being displayed. It does not happen when you use arrow keys but it's irrelevant - it should work with Tab too, considering there are no issues with adding new rows with Enter when minSpareRows is set to 1. I guess blocking Tab key for users or using minSpareCols: 2, in which case, interestingly, there's no such problem, is some kind of workaround, but regardless, it should be fixed.

Handsontable version 0.38.1, bug occurs in at least latest Firefox, Chrome, Edge and IE11.

@AMBudnik
Copy link
Contributor

AMBudnik commented Apr 3, 2018

Thank you for sharing the issue @paolostyle
I have replicated it.

Here is what I've got

gif

What is interesting is the fact that the data is saved properly when we use > (right arrow) instead.

Gladly it doesn't happen for minSpareRows even if we use Tab to move down while using tabMoves: {row: 1, col: 0} settings.

The bug has been created in the 0.36.0/ PRO 1.16.0version when we have made the selection changes. It looks like tabMoves function uses selection start coordinates that are no longer available by the same reference.

@AMBudnik AMBudnik added bug Regression Issues that were created while adding new changes to the source code labels Apr 3, 2018
@AMBudnik AMBudnik changed the title When minSpareCols is set to 1, using Tab key to create new columns deletes data from previous columns [0.36.0+] When minSpareCols is set to 1, using Tab key to create new columns deletes data from previous columns Apr 3, 2018
@wojciechczerniak wojciechczerniak added this to the May 2018 milestone Apr 3, 2018
@mrpiotr-dev mrpiotr-dev self-assigned this Apr 11, 2018
mrpiotr-dev pushed a commit that referenced this issue Apr 16, 2018

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
… (#5036)

* Fix: minSpareCols should works with new selection transformation. #4986

* Added: test to prevent regression with selection and minSpareCols. #4986

* Reverted: unnecessary changes in core.setDataAtCell. #4986
mohammed90 pushed a commit to mohammed90/handsontable that referenced this issue Apr 28, 2018
…dsontable#4986 (handsontable#5036)

* Fix: minSpareCols should works with new selection transformation. handsontable#4986

* Added: test to prevent regression with selection and minSpareCols. handsontable#4986

* Reverted: unnecessary changes in core.setDataAtCell. handsontable#4986
@AMBudnik
Copy link
Contributor

Hi @paolostyle

thank you again for sharing.
We're fixed the issue in version 3.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Core: Spare rows/columns Plugin Regression Issues that were created while adding new changes to the source code Status: Released
Projects
None yet
Development

No branches or pull requests

4 participants