Facing one problem with my component that I cannot solve with React 15. Everything works as expected, except for IE 11.
It looks like IE 11 is ignoring the event.preventDefault () function (and all the commented functions in the code below, tried with all of them) and sends the data. The page reloads, and the request parameters are specified in the URL. I would like to prevent the page from reloading and only execute logic in the handleSubmit function.
Form in render function:
<form onSubmit={this.handleSubmit}> <input ref="email" type="email" name="username" required></input> <input ref="pass" type="password" name="pass"required></input> <input type="submit" name="login" value="Login" /> </form>
and this is the hanleSubmit function:
handleSubmit: function (event) { event.preventDefault(); //event.returnValue = false; //event.stopPropagation(); //event.nativeEvent.preventDefault(); var email = this.refs.email.value; var pass = this.refs.pass.value; //return false; },
source share