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

Add support for custom widget options #250

Closed
n1k0 opened this issue Jun 29, 2016 · 0 comments
Closed

Add support for custom widget options #250

n1k0 opened this issue Jun 29, 2016 · 0 comments

Comments

@n1k0
Copy link
Collaborator

n1k0 commented Jun 29, 2016

We should add support for options to custom widgets, so these could access them as props.

const CustomWidget(props) {
  const {value, onChange, options} = props;
  return <div className={options.className} />;
}

const uiSchema = {
  "ui:widget": {
    widget: CustomWidget, 
    options: {
      className: "toto"
    }
  }
};
@n1k0 n1k0 closed this as completed in 6a2b0d1 Jun 30, 2016
n1k0 added a commit that referenced this issue Jun 30, 2016
Changelog
---------

- Fixes #250: Add support for [custom widget options](https://github.com/mozilla-services/react-jsonschema-form/blob/master/README.md#custom-widget-options). (#252)

Breaking changes
----------------

The `options` prop passed to your custom widget can now be used for any purpose, and not only the list of options (`label` and `value`) for enum fields. This latter list of options is now passed in an `enumOptions` property in the `options` prop.
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

1 participant