Skip to content
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

Closed

Conversation

zGrav
Copy link
Collaborator

@zGrav zGrav commented Dec 24, 2017

…Content ends in whitespace, replace it with unicode no-break space

Fix for #1481

Copy link
Collaborator

@skogsmaskin skogsmaskin left a 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)) {
Copy link
Collaborator

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?

Copy link
Collaborator Author

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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment should be updated.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

Copy link
Collaborator

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.

@skogsmaskin
Copy link
Collaborator

skogsmaskin commented Jan 10, 2018

@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.

@zGrav zGrav changed the title fix(slate-react/components/content): if IS_SAFARI and anchorNode text… fix(slate-react/components/content): do not use range.extend on Safari Jan 10, 2018
@zGrav zGrav changed the title fix(slate-react/components/content): do not use range.extend on Safari fix(slate-react/components/content): do not use range.extend on Safari Desktop/iOS Jan 10, 2018
@kinhbang89
Copy link

ANy update on this PR? I got the same error in Safari

@ianstormtaylor
Copy link
Owner

Can anyone verify this? Looking at the support tables it says that selection.extend is supported in Safari? Is it something specific we're doing wrong?

@ianstormtaylor ianstormtaylor mentioned this pull request Nov 14, 2019
@ianstormtaylor
Copy link
Owner

Fixed by #3093.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants