glimmer-vm icon indicating copy to clipboard operation
glimmer-vm copied to clipboard

IE11 - Error when element's innerHTML is changed before glimmer tries to modify it

Open HuggableSquare opened this issue 9 years ago • 3 comments
trafficstars

IE bug report here: https://connect.microsoft.com/IE/feedbackdetail/view/944330/invalid-argument-error-when-changing-nodevalue-of-a-text-node-removed-by-setting-innerhtml-on-an-ancestor

Basically, if an element's innerHTML is replaced before glimmer tries to insert text (due to the element having handlebars markup inside of it), IE11 errors out.

The line that errors is here: https://github.com/tildeio/glimmer/blob/3437ee92284317f3bf32b661cb1089e2915f7213/packages/glimmer-runtime/lib/upsert.ts#L75

Wrapping that line in a try/catch seems to work and give the same functionality as in Chrome (the original innerHTML modification takes precedent, because glimmer is modifying an non-existent node).

EDIT: Wrapping it in a try/catch, and returning false in the catch does not work, but returning true does.

HuggableSquare avatar Nov 15 '16 15:11 HuggableSquare

I recently ran into this same issue, in my case I was able to fix it by removing some jQuery code that was also trying to modify the same element (FWIW, not my jQuery code, and I was glad to have an excuse to remove it.)

Just wanted to point out that this seems likely to happen in situations where some external (to Ember/Glimmer) JavaScript is modifying the DOM as well. I do think that if IE11 is a supported browser, the fix described seems like it should be viable and should be applied (assuming no weird side effects from doing so).

localpcguy avatar Jun 09 '17 19:06 localpcguy

I'm doing some issue gardening 🌱🌿 🌷 and came upon this issue. Since it's quite old I just wanted to ask if this is still relevant? If it isn't, maybe we can close this issue?

By closing some old issues we reduce the list of open issues to a more manageable set.

sandstrom avatar Aug 25 '21 14:08 sandstrom

Ie11 is no longer supported, no i think we can close this?

NullVoxPopuli avatar Jan 27 '22 04:01 NullVoxPopuli