-
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
fix(slate-react/components/content): do not use range.extend on Safari Desktop/iOS #1490
fix(slate-react/components/content): do not use range.extend on Safari Desktop/iOS #1490
Conversation
…Content ends in whitespace, replace it with unicode no-break space
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.
.
@@ -206,7 +207,7 @@ class Content extends React.Component { | |||
native.removeAllRanges() | |||
|
|||
// COMPAT: IE 11 does not support Selection.extend | |||
if (native.extend) { | |||
if ((native.extend && !IS_IOS) && (native.extend && !IS_SAFARI)) { |
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.
Maybe if (native.extend && !(IS_SAFARI || IS_IOS))
for more clarity?
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.
you are indeed correct! ;)
@@ -206,7 +207,7 @@ class Content extends React.Component { | |||
native.removeAllRanges() | |||
|
|||
// COMPAT: IE 11 does not support Selection.extend |
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.
Comment should be updated.
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.
Done!
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.
Great, but also keep the IE-comment about not supporting range.extend please.
@zGrav Can you please utdate the title and description of this PR? It is a bit confusing in it's current state. Also I have a feeling it is solving something the wrong way (though it is plausible we don't have anything better to come up with atm). I will have a closer look tomorrow when I have the Safari stack around. |
ANy update on this PR? I got the same error in Safari |
Can anyone verify this? Looking at the support tables it says that |
Fixed by #3093. |
…Content ends in whitespace, replace it with unicode no-break space
Fix for #1481