**Do you want to request a *feature* or report a *bug*?**
Bug

**What is the current behavior?**
When an input field changes from "email" to "text", an exception TypeError will be thrown from setSelection.
![Screenshot](https://raw.githubusercontent.com/adrianimboden/react-bug-reproduction/master/screenshot.png)

**Reproduction**
See here: https://github.com/adrianimboden/react-bug-reproduction

**What is the expected behavior?**
It should not crash because of an uncaught exception

**Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?**
master (https://github.com/facebook/react/commit/4ca7855ca062d5d7dfca83c86acf46731e1e57ef)
Firefox

This would be my proposed change to fix the issue: https://github.com/adrianimboden/react/commit/db923b8c3c1cb23ad9fb150c160ce56f39dd3cae
</TestCase.Steps>
          <TestCase.ExpectedResult>
            The text field's cursor should not jump to the end.
          </TestCase.ExpectedResult>
          <InputTestCase type="url" defaultValue="" />
        </TestCase>
        <TestCase title="All inputs" description="General test of all inputs">
          <InputTestCase type="text" defaultValue="Text" />
          <InputTestCase type="email" defaultValue="user@example.com" />
          <InputTestCase type="number" defaultValue={0} />
          <InputTestCase type="url" defaultValue="http://example.com" />
          <InputTestCase type="tel" defaultValue="555-555-5555" />
          <InputTestCase type="color" defaultValue="#ff0000" />
          <InputTestCase type="date" defaultValue="2017-01-01" />
          <InputTestCase
            type="datetime-local"
            defaultValue="2017-01-01T01:00"
          />
          <InputTestCase type="time" defaultValue="01:00" />
          <InputTestCase type="month" defaultValue="2017-01" />
          <InputTestCase type="week" defaultValue="2017-W01" />
          <InputTestCase type="range" defaultValue={0.5} />
          <InputTestCase type="password" defaultValue="" />
        </TestCase>
      </FixtureSet>
    );
  }
}
export default TextInputFixtures;