Skip to content

Commit

Permalink
Fix IE11 not able to submit (#1432)
Browse files Browse the repository at this point in the history
* Fix #1431 - ie11 not able to submit

* Fix code formatting

* Add react-app-polyfill/ie11 for playground
  • Loading branch information
Marton Bodonyi authored and epicfaace committed Nov 9, 2019
1 parent 1202e22 commit e421444
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions playground/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import MonacoEditor from "react-monaco-editor";
import { shouldRender } from "../src/utils";
import { samples } from "./samples";
import Form from "../src";
import "react-app-polyfill/ie11";

const log = type => console.log.bind(console, type);
const toJson = val => JSON.stringify(val, null, 2);
Expand Down
6 changes: 5 additions & 1 deletion src/components/Form.js
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,11 @@ export default class Form extends Component {

submit() {
if (this.formElement) {
this.formElement.dispatchEvent(new Event("submit", { cancelable: true }));
this.formElement.dispatchEvent(
new CustomEvent("submit", {
cancelable: true,
})
);
}
}

Expand Down

0 comments on commit e421444

Please sign in to comment.