Separate the identification and removal of attributes#4911
Separate the identification and removal of attributes#4911Conduitry merged 1 commit intosveltejs:masterfrom aredridel:fix-edge-hydration-of-input
Conversation
Because EdgeHTML does not actually remove the 'value' attribute from an HTMLInputElement, the prior iteration would generate an infinite loop. By making this two passes, we are a bit less memory efficient but avoid the nasty edge cases when DOM elements don't fully respect the API.
|
Do you have a repro in which this issue currently manifests itself in old Edge? |
|
I can build one. I ran into this today in QA for a release. I'll see if I can make a nice minimal repro in the morning. |
|
@Conduitry repro at https://github.com/aredridel/svelte-bug-repro; key files are index.svelte and index.html, the rest are build tooling or build product for examination. |
|
I found this issue searching for a solution to exactly this problem. The problem makes forms with bound inputs unusable in most if not all non-Chromium versions of MS Edge and is a blocker to production use. I have reproduced and can confirm that this PR solves the problem - good catch! If it has no negative side-effects I'd love to see it merged to master. |
|
@rodoch Indeed. We've gone to prod with a patch applied via the |
|
This has been released in 3.23.1 - thanks! |
Because EdgeHTML does not actually remove the
valueattribute from anHTMLInputElement, the prior implementation would generate an infinite loop. By making this two passes, we are a bit less memory efficient but avoid the nasty edge cases when DOM elements don't fully respect the API.I believe the existing tests, if they were to run against Edge, would suffer from this case. I was unable to do so as the harness is not configured in a way to make that easy, however, it does fix the case I discovered this with in situ.