{"action":"created","issue":{"url":"https://api.github.com/repos/erikras/redux-form/issues/1082","repository_url":"https://api.github.com/repos/erikras/redux-form","labels_url":"https://api.github.com/repos/erikras/redux-form/issues/1082/labels{/name}","comments_url":"https://api.github.com/repos/erikras/redux-form/issues/1082/comments","events_url":"https://api.github.com/repos/erikras/redux-form/issues/1082/events","html_url":"https://github.com/erikras/redux-form/issues/1082","id":157721280,"number":1082,"title":"v6: FieldArray.push + immutable causes \"TypeError: list.splice is not a function\"","user":{"login":"Pongetti","id":1473489,"avatar_url":"https://avatars.githubusercontent.com/u/1473489?v=3","gravatar_id":"","url":"https://api.github.com/users/Pongetti","html_url":"https://github.com/Pongetti","followers_url":"https://api.github.com/users/Pongetti/followers","following_url":"https://api.github.com/users/Pongetti/following{/other_user}","gists_url":"https://api.github.com/users/Pongetti/gists{/gist_id}","starred_url":"https://api.github.com/users/Pongetti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Pongetti/subscriptions","organizations_url":"https://api.github.com/users/Pongetti/orgs","repos_url":"https://api.github.com/users/Pongetti/repos","events_url":"https://api.github.com/users/Pongetti/events{/privacy}","received_events_url":"https://api.github.com/users/Pongetti/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/erikras/redux-form/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/erikras/redux-form/milestones/1","html_url":"https://github.com/erikras/redux-form/milestones/next-6.0.0","labels_url":"https://api.github.com/repos/erikras/redux-form/milestones/1/labels","id":1736711,"number":1,"title":"next-6.0.0","description":"","creator":{"login":"ooflorent","id":168498,"avatar_url":"https://avatars.githubusercontent.com/u/168498?v=3","gravatar_id":"","url":"https://api.github.com/users/ooflorent","html_url":"https://github.com/ooflorent","followers_url":"https://api.github.com/users/ooflorent/followers","following_url":"https://api.github.com/users/ooflorent/following{/other_user}","gists_url":"https://api.github.com/users/ooflorent/gists{/gist_id}","starred_url":"https://api.github.com/users/ooflorent/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ooflorent/subscriptions","organizations_url":"https://api.github.com/users/ooflorent/orgs","repos_url":"https://api.github.com/users/ooflorent/repos","events_url":"https://api.github.com/users/ooflorent/events{/privacy}","received_events_url":"https://api.github.com/users/ooflorent/received_events","type":"User","site_admin":false},"open_issues":11,"closed_issues":58,"state":"open","created_at":"2016-04-28T15:08:08Z","updated_at":"2016-05-31T17:08:24Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2016-05-31T17:01:17Z","updated_at":"2016-06-01T10:20:26Z","closed_at":null,"body":"Hello all!  I've put some test code below.  Its fairly simple.  Just a button \"Add Row\" and a text box for each row in the FieldArray.\r\n\r\n```\r\n\r\nimport {Field, FieldArray, reduxForm} from \"redux-form/immutable\";\r\n\r\n@reduxForm({\r\n\tform: \"servicesForm\"\r\n})\r\nexport class TestingBedPage extends React.Component {\r\n\r\n\trender() {\r\n\t\treturn (\r\n\t\t\t<div>\r\n\t\t\t\r\n\t\t\t<FieldArray\r\n\t\t\t\tname=\"services\"\r\n\t\t\t\tcomponent={fields =>\r\n\t\t\t\t\t<div>\r\n\t\t\t\t\t\t<button onClick={() => fields.push(Map({}))}>Add Row</button>\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{fields.map( row => {\r\n\t\t\t\t\t\t\treturn <Field key={row} name={row + \".service_length\"} component={field => <input type=\"text\" {...field} />} />\r\n\t\t\t\t\t\t})}\r\n\t\t\t\t\t</div>\r\n\t\t\t\t}\r\n\t\t\t/>\r\n\r\n\t\t\t</div>\r\n\t\t)\r\n\t}\r\n}\r\n\r\n\r\n```\r\n\r\nFirst I click Add Row once or twice to get some empty rows.  This works without issue.\r\nI then focus on any of the input boxes.\r\nI then click Add Row again but this time I get \"TypeError: list.splice is not a function\"\r\n\r\nThis doesn't occur if I switch to the non-immutable version of redux-form.\r\n\r\nI'm using 6.0.0-alpha.13.  I didn't try with this exact code snippet with alpha 14 but in my real code I still had the same issue with 14 (I'm having some other issues with it so switched back to 13 for now)\r\n\r\nThanks!"},"comment":{"url":"https://api.github.com/repos/erikras/redux-form/issues/comments/222952339","html_url":"https://github.com/erikras/redux-form/issues/1082#issuecomment-222952339","issue_url":"https://api.github.com/repos/erikras/redux-form/issues/1082","id":222952339,"user":{"login":"Palid","id":3636685,"avatar_url":"https://avatars.githubusercontent.com/u/3636685?v=3","gravatar_id":"","url":"https://api.github.com/users/Palid","html_url":"https://github.com/Palid","followers_url":"https://api.github.com/users/Palid/followers","following_url":"https://api.github.com/users/Palid/following{/other_user}","gists_url":"https://api.github.com/users/Palid/gists{/gist_id}","starred_url":"https://api.github.com/users/Palid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Palid/subscriptions","organizations_url":"https://api.github.com/users/Palid/orgs","repos_url":"https://api.github.com/users/Palid/repos","events_url":"https://api.github.com/users/Palid/events{/privacy}","received_events_url":"https://api.github.com/users/Palid/received_events","type":"User","site_admin":false},"created_at":"2016-06-01T10:20:26Z","updated_at":"2016-06-01T10:20:26Z","body":"The problem is this code in file `/lib/structure/immutable/index.js`:\r\n```js\r\n  splice: function splice() {\r\n    var list = arguments.length <= 0 || arguments[0] === undefined ? (0, _immutable.List)() : arguments[0];\r\n    var index = arguments[1];\r\n    var removeNum = arguments[2];\r\n    var value = arguments[3];\r\n    return removeNum ? list.splice(index, removeNum) : list.splice(index, 0, value);\r\n  }\r\n```\r\nIt gets Map as the 'list', so instead of splicing it it just throws an error."}}
{"actor":{"display_login":"Palid"}}