{"action":"created","issue":{"url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/issues/297","labels_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/issues/297/labels{/name}","comments_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/issues/297/comments","events_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/issues/297/events","html_url":"https://github.com/react-bootstrap/react-bootstrap/issues/297","id":50873972,"number":297,"title":"Issues while testing Bootstrap components.","user":{"login":"Nutelac","id":8208377,"avatar_url":"https://avatars.githubusercontent.com/u/8208377?v=3","gravatar_id":"","url":"https://api.github.com/users/Nutelac","html_url":"https://github.com/Nutelac","followers_url":"https://api.github.com/users/Nutelac/followers","following_url":"https://api.github.com/users/Nutelac/following{/other_user}","gists_url":"https://api.github.com/users/Nutelac/gists{/gist_id}","starred_url":"https://api.github.com/users/Nutelac/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nutelac/subscriptions","organizations_url":"https://api.github.com/users/Nutelac/orgs","repos_url":"https://api.github.com/users/Nutelac/repos","events_url":"https://api.github.com/users/Nutelac/events{/privacy}","received_events_url":"https://api.github.com/users/Nutelac/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/labels/needs%20better%20docs","name":"needs better docs","color":"fad8c7"},{"url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/labels/question","name":"question","color":"cc317c"}],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/milestones/1","html_url":"https://github.com/react-bootstrap/react-bootstrap/milestones/1.0.0%20Release","labels_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/milestones/1/labels","id":1081597,"number":1,"title":"1.0.0 Release","description":"See: https://github.com/react-bootstrap/react-bootstrap/wiki#100-roadmap-draft","creator":{"login":"mtscout6","id":736870,"avatar_url":"https://avatars.githubusercontent.com/u/736870?v=3","gravatar_id":"","url":"https://api.github.com/users/mtscout6","html_url":"https://github.com/mtscout6","followers_url":"https://api.github.com/users/mtscout6/followers","following_url":"https://api.github.com/users/mtscout6/following{/other_user}","gists_url":"https://api.github.com/users/mtscout6/gists{/gist_id}","starred_url":"https://api.github.com/users/mtscout6/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mtscout6/subscriptions","organizations_url":"https://api.github.com/users/mtscout6/orgs","repos_url":"https://api.github.com/users/mtscout6/repos","events_url":"https://api.github.com/users/mtscout6/events{/privacy}","received_events_url":"https://api.github.com/users/mtscout6/received_events","type":"User","site_admin":false},"open_issues":16,"closed_issues":24,"state":"open","created_at":"2015-04-24T02:41:37Z","updated_at":"2015-07-06T14:57:17Z","due_on":null,"closed_at":null},"comments":17,"created_at":"2014-12-03T18:31:10Z","updated_at":"2015-07-07T18:42:06Z","closed_at":"2015-06-29T09:34:42Z","body":"I found few issues while testing app with React.addons.TestUtils.\r\n\r\n#### 1. ref does not work on ModalTrigger children\r\n\r\n##### code\r\n```javascript\r\nvar Modal = React.createClass({\r\n  render: function(){\r\n    return Bootstrap.ModalTrigger({\r\n      modal: Bootstrap.Modal({\r\n        title: 'modal'\r\n      })\r\n    }, Bootstrap.Button({\r\n      ref: 'button'\r\n    }));\r\n  }\r\n});\r\n```\r\n##### test\r\n```javascript\r\nvar modal = TestUtils.renderIntoDocument(Modal(null));\r\nexpect(modal.refs.button).toBeTruthy(); // Expected undefined to be truthy.\r\n```\r\n\r\n#### 2. can't change input value via TestUtils.Simulate.change\r\n##### code\r\n```javascript\r\nvar Input = React.createClass({\r\n  render: function(){\r\n    return Bootstrap.Input({\r\n      ref: 'input',\r\n      type: 'text'\r\n    });\r\n  }\r\n});\r\n```\r\n##### test\r\n```javascript\r\nvar input = TestUtils.renderIntoDocument(Input(null));\r\nTestUtils.Simulate.change(input.refs.input.getDOMNode(), {\r\n  target: {\r\n    value: 'foo'\r\n  }\r\n});\r\nexpect(input.refs.input.getValue()).toBe('foo'); // Expected: null toBe: 'foo'\r\n```\r\n\r\nIs this expected behaviour or bug? Thank you."},"comment":{"url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/issues/comments/119298271","html_url":"https://github.com/react-bootstrap/react-bootstrap/issues/297#issuecomment-119298271","issue_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/issues/297","id":119298271,"user":{"login":"chiedojohn","id":2156688,"avatar_url":"https://avatars.githubusercontent.com/u/2156688?v=3","gravatar_id":"","url":"https://api.github.com/users/chiedojohn","html_url":"https://github.com/chiedojohn","followers_url":"https://api.github.com/users/chiedojohn/followers","following_url":"https://api.github.com/users/chiedojohn/following{/other_user}","gists_url":"https://api.github.com/users/chiedojohn/gists{/gist_id}","starred_url":"https://api.github.com/users/chiedojohn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chiedojohn/subscriptions","organizations_url":"https://api.github.com/users/chiedojohn/orgs","repos_url":"https://api.github.com/users/chiedojohn/repos","events_url":"https://api.github.com/users/chiedojohn/events{/privacy}","received_events_url":"https://api.github.com/users/chiedojohn/received_events","type":"User","site_admin":false},"created_at":"2015-07-07T18:42:06Z","updated_at":"2015-07-07T18:42:06Z","body":"Correct, here is the handleInputChange mixin.\r\n\r\n```\r\n  handleInputChange: function(ev) {\r\n    var nextState = _.cloneDeep(this.state);\r\n    nextState[ev.target.name] = ev.target.value;\r\n    this.setState(nextState);\r\n  },\r\n\r\n```\r\n\r\nI'm using lodash.js for the _cloneDeep functionality.\r\n\r\nThanks again for your help thus far."}}