-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issues in IE 11 #1756
Issues in IE 11 #1756
Conversation
A bit unrelated question: Have you tried I remember there are several includes methods requiring |
Hi @zhujinxuan, didn't try it in this case, but use some other polyfills in my project like: |
would be awesome to get this in, looks like the build error is just from prettier not liking a semicolon. |
for more context, we are seeing the same issues in IE 11 with default |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not a maintainer of this project, but I've made a few suggestions. Overall these changes look good!
@@ -327,8 +329,8 @@ class Html { | |||
const { document } = value | |||
const elements = document.nodes.map(this.serializeNode).filter(el => el) | |||
if (options.render === false) return elements | |||
|
|||
const html = renderToStaticMarkup(<body>{elements}</body>) | |||
// Converts List to Array to support IE 11. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this and similar comments be updated to say COMPAT: Converts List to Array for IE11 support
for consistency with other compatibility comments?
@@ -343,14 +345,17 @@ class Html { | |||
serializeNode = node => { | |||
if (node.object === 'text') { | |||
const leaves = node.getLeaves() | |||
return leaves.map(this.serializeLeaf) | |||
const children = leaves.map(this.serializeLeaf); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this semicolon needs to be removed.
@@ -121,6 +121,8 @@ class Html { | |||
*/ | |||
|
|||
deserialize = (html, options = {}) => { | |||
// Provides default value to make it working in IE 11. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we update this comment to something along these lines: COMPAT: Provide a default value for IE11 support
Hey @ikorgik, thank you for this. Could you make the changes to the comments to append For the serializer change, does it need to be |
I'm hitting the same problem in IE11.
Is there an interim fix that I might be able to use in the meantime? |
Hi, we are facing issues in IE11 as well. We are using the slate-html-serializer, which we could fix its incompatibility by having a default initial state of |
One of my teammates reported me this: "The problem is that IE11 lets users select placeholder text, which is disabled with css on other browsers. Dunno if that is helpful for you in any way. I will take a look at it pretty soon anyways ;) |
I think I managed to track down the
|
#### Is this adding or improving a _feature_ or fixing a _bug_? This should fix `Unable to get property 'childNodes' of undefined or null reference` error in IE11 when using slate-html-serializer and deserializing an empty string (#1757, #1756). #### What's the new behavior? The `defaultParseHtml` now returns an empty body element if the parsed body is null. I tested this in the latest Chrome, Firefox and Safari, and they all seemed to work similarly. If the html param was an empty string, `parseFromString` returned a document element, which had a body property which was an empty body element. In IE11 though the body property was null, which caused the undefined or null reference later. #### Have you checked that...? * [x] The new code matches the existing patterns and styles. * [x] The tests pass with `yarn test`. * [x] The linter passes with `yarn lint`. (Fix errors with `yarn prettier`.) * [x] The relevant examples still work. (Run examples with `yarn watch`.)
#### Is this adding or improving a _feature_ or fixing a _bug_? This should fix `Unable to get property 'childNodes' of undefined or null reference` error in IE11 when using slate-html-serializer and deserializing an empty string (ianstormtaylor#1757, ianstormtaylor#1756). #### What's the new behavior? The `defaultParseHtml` now returns an empty body element if the parsed body is null. I tested this in the latest Chrome, Firefox and Safari, and they all seemed to work similarly. If the html param was an empty string, `parseFromString` returned a document element, which had a body property which was an empty body element. In IE11 though the body property was null, which caused the undefined or null reference later. #### Have you checked that...? * [x] The new code matches the existing patterns and styles. * [x] The tests pass with `yarn test`. * [x] The linter passes with `yarn lint`. (Fix errors with `yarn prettier`.) * [x] The relevant examples still work. (Run examples with `yarn watch`.)
As of #3093 (which was just merged), I believe this issue is no longer applicable, because a lot has changed. I'm going through and closing out any potential issues that are not out of date with the overhaul. Thanks for understanding. |
Fixes for several issues in IE 11 we found during slate integration: