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

Default for dropdowns expects object #3

Open
mryellow opened this issue Jul 21, 2020 · 1 comment
Open

Default for dropdowns expects object #3

mryellow opened this issue Jul 21, 2020 · 1 comment

Comments

@mryellow
Copy link
Collaborator

A spec defined with a default: 'string' failed with a warning:

Invalid prop: type check failed for prop "data". Expected Object, got String with value "status2".

{
  type: 'mgChoiceDropdown',
  id: 'field',
  title: 'Field Title',
  default: 'status2',
  enum: [
    { id: 'status1', title: 'Status1' },
    { id: 'status2', title: 'Status2' },
    { id: 'status3', title: 'Status3' },
    { id: 'status4', title: 'Status4' },
  ],
};

Succeeded as an object:

{
  type: 'mgChoiceDropdown',
  id: 'field',
  title: 'Field Title',
  default: { id: 'status2' },
  enum: [
    { id: 'status1', title: 'Status1' },
    { id: 'status2', title: 'Status2' },
    { id: 'status3', title: 'Status3' },
    { id: 'status4', title: 'Status4' },
  ],
};

An example within mgText is set to default: 'off' and is likely incorrect.

default: 'off',

@mryellow
Copy link
Collaborator Author

Unsure. May be invalid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant