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

Array data is not handled correctly in populateFromArray #5675

Closed
jdmcnair opened this issue Dec 14, 2018 · 2 comments
Closed

Array data is not handled correctly in populateFromArray #5675

jdmcnair opened this issue Dec 14, 2018 · 2 comments

Comments

@jdmcnair
Copy link
Contributor

jdmcnair commented Dec 14, 2018

Description

If cell data is represented by an array, and the array data changes from a populated array to an empty array (or vice versa), the populateFromArray code produces a null change set. This happens because the value passed to duckSchema resolves differently for an empty array than for an array with elements. This happens in other scenarios as well, say where a populated array has string value selections and the changed strings are different lengths.

Steps to reproduce

  1. Use an array data type for a column. I'm using a custom multiselect editor, which is how the array data is being edited.
  2. Change the array selection from an array with at least one element to an empty array.
  3. See that the changes are rejected because the changeset returned from populateFromArray is null.

Demo

I've created pull request #5676 with a unit test that demonstrates the issue.

Your environment

  • Handsontable version: 6.1.1
  • Browser Name and version: Chrome 70.0.3538.102
  • Operating System: Win10
jdmcnair added a commit to jdmcnair/handsontable that referenced this issue Dec 14, 2018
jdmcnair added a commit to jdmcnair/handsontable that referenced this issue Dec 14, 2018
@AMBudnik
Copy link
Contributor

Thank you very much for spotting that and sharing the pull request, Jason.

@AMBudnik AMBudnik added the bug label Dec 20, 2018
@wojciechczerniak wojciechczerniak added this to the February 2019 milestone Jan 8, 2019
@jansiegel jansiegel self-assigned this Feb 11, 2019
jansiegel pushed a commit that referenced this issue Feb 14, 2019
* test establishing problem described in issue #5675

* resolution for issue #5675: correct array handling in populateFromArray

* fixing lint error

* added further fix for handling array data and initial null value

* fixing lint issue

* removing junk comments
@AMBudnik
Copy link
Contributor

AMBudnik commented Mar 6, 2019

And another change for v7.0.0 :) Thank you @jdmcnair

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

4 participants