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

Pass along label/placeholder/registry for custom multiselect widgets. #1301

Merged
merged 1 commit into from
Jun 3, 2019
Merged

Pass along label/placeholder/registry for custom multiselect widgets. #1301

merged 1 commit into from
Jun 3, 2019

Conversation

fsteger
Copy link
Contributor

@fsteger fsteger commented May 29, 2019

Reasons for making this change

Inconsistency between properties passed to custom select widgets. When widget is for a question of type string with an enum, the custom widget receives props for label, placeholder, and registry. When widget is used on a multi-select field, these properties are missing.

Sample Schema:

{
	type: 'object',
	properties: {
		selectQuestion: {
			title: 'Select Question',
			type: 'string',
			enum: ['foo', 'bar', 'baz', 'qux'],
			enumNames: ['foo', 'bar', 'baz', 'qux']
		},
		multiSelectQuestion: {
			title: 'Multi-Select Question',
			type: 'array',
			uniqueItems: true,
			items: {
				type: 'string',
				enum: ['foo', 'bar', 'baz', 'qux'],
				enumNames: ['foo', 'bar', 'baz', 'qux']
			}
		}
}

Sample UI Schema:

{
	selectQuestion: {
		'ui:widget': 'select'
	},
	multiSelectQuestion: {
		'ui:widget': 'select'
	}
}

Checklist

  • I'm updating documentation
  • I'm adding or updating code
    • I've added and/or updated tests
    • I've updated docs if needed
    • [X I've run npm run cs-format on my branch to conform my code to prettier coding style
  • I'm adding a new feature
    • I've updated the playground with an example use of the feature

@epicfaace
Copy link
Member

Thanks! The default MultiSelectWidget doesn't do anything with label/placeholder though -- do you think there is something we should do to change that?

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

Successfully merging this pull request may close these issues.

3 participants