Skip to content

checklist ignores model update when value is array or object #423

Open
@networkimprov

Description

@networkimprov

Bug Report

The following field (without a validator) cannot be updated via the model. No errors or warnings are logged:

{ "label":"ANR",
  "model":"or.anr",
  "type":"checklist",
  "listBox":true,
  "values": [
      {"name":"a", "value":[1,2]},
      {"name":"b", "value":[2,2]}
   ] }

model.or.anr = [[1,2]]; // fails to check "a"

If you would like a jsfiddle demo, let me know.

Docs do not say that name/value checklist items cannot handle array/object values.

Suggested fix: store the schema's name/value objects in the model's values array, and locate them by name using findIndex(function(i){ return i.name === theName }).

  • Version: 2.2.0
  • Browser: FF 59 (latest)
  • Language: Firefox default JS

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions