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

Setting multi-select value to empty array results in validation errors #421

Open
TheOtherDude opened this issue May 24, 2017 · 2 comments
Open

Comments

@TheOtherDude
Copy link
Contributor

TheOtherDude commented May 24, 2017

If you have a field that uses a multi-select renderer, and you set the value of that field to [], the form fails validation and ceases to render. See screenshot for error message.

screen shot 2017-05-24 at 3 16 11 pm

This was my model:

export default {
  type: 'object',
  properties: {
    // If we provide this in our value, Bunsen will use it to query templates
    accountId: {
      type: 'integer'
    },
    template: {
      labelAttribute: 'frostSelectItemLabel', // Name of property to use for text shown in select
      modelType: 'template', // Name of Ember Data model
      items: {
        type: 'string'
      },
      query: {
        'account-id': '${../accountId}', // Get value from relative bunsen property
        'filter': '[name]=$filter'
      },
      type: 'array',
      valueAttribute: 'id' // Name of property to feed into bunsen form value
    }
  },

  required: ['template']
}
@job13er
Copy link
Contributor

job13er commented May 24, 2017

That's really weird, that makes it sound like the items is getting cleared out or something from the model. Wonder how that could be happening...

@notmessenger
Copy link
Contributor

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

3 participants