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

Comments

Projects
None yet
4 participants
@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

This comment has been minimized.

Copy link
Contributor

AMBudnik commented Dec 20, 2018

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

@AMBudnik AMBudnik added the Type: 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 added a commit that referenced this issue Feb 14, 2019

Resolving issue #5675: Array data handling in populateFromArray (#5676)
* 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

This comment has been minimized.

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
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.