question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

dispatchEvent submit does not work in ie11

See original GitHub issue

Prerequisites

Description

In Internet Explorer when attempting to submit the form, the following error occurs:

image

Steps to Reproduce

Submit a form.

Expected behavior

The form to submit.

Actual behavior

Error in ie11.

Version

Latest

I’ll probably have to come up with a way of polyfilling the Event on the form but I’m wondering why dispatchEvent was chosen in the first place over calling .submit directly on the form element?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
KKS1commented, Oct 14, 2019

For anyone else having this issue, this is how I am resolving it-:

(function () {
  if (typeof Event !== 'function') {
    window.Event = CustomEvent;
  }
})();

along with adding https://www.npmjs.com/package/custom-event-polyfill.
0reactions
KKS1commented, Oct 11, 2019

Thanks for looking into the fix. Is there an ETA on when this is targeted for merge and release creation ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

dispatchEvent in Chrome but not in IE11 - Stack Overflow
This works in Chrome. The purpose of this command is to make a division call the submit event on a form when clicked....
Read more >
730108 - In theory, dispatchEvent(new Event('submit')) should ...
This is a bug of Firefox. Dispatching non-trusted 'submit' event should not start form submission. The specification doesn't define such ...
Read more >
preventDefault() on form.dispatchEvent(new Event('submit'))?
Bug 1370630 - Untrusted submit event shouldn't trigger form submission ... preventDefault()` won't work) - Chrome will not navigate away (`event.
Read more >
When a Click is Not Just a Click | CSS-Tricks
It works on just about every HTML element there is, ... The HTML element represents a clickable button, used to submit forms or...
Read more >
Maps JavaScript API Release Notes - Google Developers
Internet Explorer 11 is now decommissioned in the Maps Embed API. ... Updated InfoWindow , so that focus does not move when open()...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found