{"action":"created","issue":{"url":"https://api.github.com/repos/mozilla-services/react-jsonschema-form/issues/225","repository_url":"https://api.github.com/repos/mozilla-services/react-jsonschema-form","labels_url":"https://api.github.com/repos/mozilla-services/react-jsonschema-form/issues/225/labels{/name}","comments_url":"https://api.github.com/repos/mozilla-services/react-jsonschema-form/issues/225/comments","events_url":"https://api.github.com/repos/mozilla-services/react-jsonschema-form/issues/225/events","html_url":"https://github.com/mozilla-services/react-jsonschema-form/pull/225","id":158254679,"number":225,"title":"Add widget capability to Array and Object fields","user":{"login":"kdmcclel","id":684040,"avatar_url":"https://avatars.githubusercontent.com/u/684040?v=3","gravatar_id":"","url":"https://api.github.com/users/kdmcclel","html_url":"https://github.com/kdmcclel","followers_url":"https://api.github.com/users/kdmcclel/followers","following_url":"https://api.github.com/users/kdmcclel/following{/other_user}","gists_url":"https://api.github.com/users/kdmcclel/gists{/gist_id}","starred_url":"https://api.github.com/users/kdmcclel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kdmcclel/subscriptions","organizations_url":"https://api.github.com/users/kdmcclel/orgs","repos_url":"https://api.github.com/users/kdmcclel/repos","events_url":"https://api.github.com/users/kdmcclel/events{/privacy}","received_events_url":"https://api.github.com/users/kdmcclel/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2016-06-02T22:33:23Z","updated_at":"2016-07-12T10:49:07Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/mozilla-services/react-jsonschema-form/pulls/225","html_url":"https://github.com/mozilla-services/react-jsonschema-form/pull/225","diff_url":"https://github.com/mozilla-services/react-jsonschema-form/pull/225.diff","patch_url":"https://github.com/mozilla-services/react-jsonschema-form/pull/225.patch"},"body":"I had an array of roles for a user which I wanted to present as switches.  I wanted to be able to do this inline without having to declare all my fields manually.  Adding the capability for a widget to be used on ArrayField and ObjectField gives more flexibility."},"comment":{"url":"https://api.github.com/repos/mozilla-services/react-jsonschema-form/issues/comments/232005046","html_url":"https://github.com/mozilla-services/react-jsonschema-form/pull/225#issuecomment-232005046","issue_url":"https://api.github.com/repos/mozilla-services/react-jsonschema-form/issues/225","id":232005046,"user":{"login":"n1k0","id":41547,"avatar_url":"https://avatars.githubusercontent.com/u/41547?v=3","gravatar_id":"","url":"https://api.github.com/users/n1k0","html_url":"https://github.com/n1k0","followers_url":"https://api.github.com/users/n1k0/followers","following_url":"https://api.github.com/users/n1k0/following{/other_user}","gists_url":"https://api.github.com/users/n1k0/gists{/gist_id}","starred_url":"https://api.github.com/users/n1k0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/n1k0/subscriptions","organizations_url":"https://api.github.com/users/n1k0/orgs","repos_url":"https://api.github.com/users/n1k0/repos","events_url":"https://api.github.com/users/n1k0/events{/privacy}","received_events_url":"https://api.github.com/users/n1k0/received_events","type":"User","site_admin":false},"created_at":"2016-07-12T10:49:07Z","updated_at":"2016-07-12T10:49:07Z","body":"> There are some field-level features though. Eg. _Ordered properties_ for objects. Custom fields based off the `ObjectField` will have to replicate this for no reason.\r\n\r\nAs far as I can tell, having *custom object widgets* wouldn't solve this, would it? What API would you provide in order for the custom widget component to know about the order of fields? \r\n\r\n> Also, your question can be extended to: Why do we need widgets when we can create custom fields? Even for primitive field types. Especially because the signature for both, is roughly the same: `f(Value, Schema, ...) -> Virtual DOM`\r\n\r\nThere's actually a [documented](https://github.com/mozilla-services/react-jsonschema-form#advanced-customization) distinction between fields and widgets:\r\n\r\n> The API allows to specify your own custom *widgets* and *fields* components:\r\n>\r\n>- A *widget* represents a HTML tag for the user to enter data, eg. `input`, `select`, etc.\r\n>- A *field* usually wraps one or more widgets and most often handles internal field state; think of a field as a form row, including the labels.\r\n\r\nThat's especially why I've always be reluctant at transforming *widgets* into more than single input components."}}
{"actor":{"display_login":"n1k0"}}