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

IE11: Doesn't allow cursor to focus or edit text on editor input #2364

Closed
lranches-sfdo opened this issue Nov 1, 2018 · 10 comments · Fixed by #2535
Closed

IE11: Doesn't allow cursor to focus or edit text on editor input #2364

lranches-sfdo opened this issue Nov 1, 2018 · 10 comments · Fixed by #2535

Comments

@lranches-sfdo
Copy link

Do you want to request a feature or report a bug?

Bug 🐛

What's the current behavior?'

ie-rteditor

Using Internet Explorer 11, if the editor input already contains text. It won't allow on click to focus on the Editor Input and edit. Also upgraded to the latest Slate versions and still has the same issue but posted the versions being used below. It also is working perfectly fine in Chrome.

Any help would be much appreciated!

    "slate": "^0.33.4",
    "slate-react": "^0.12.4",

What's the expected behavior?

Working on Chrome!

chrome-rteditor

@isubasti
Copy link
Contributor

isubasti commented Nov 1, 2018

@lranches-sfdo do you have polyfill for IE, I think it might be due to IE 11 doesn't have Element.closest and slate relies on that and it's not included hence you need to include your own.

@lranches-sfdo
Copy link
Author

@isubasti Thank you for your response. We actually have the closest polyfill for IE and still no luck :(. Any other ideas?

@lranches-sfdo
Copy link
Author

Any updates? :)

@dannyiacono
Copy link

The same issue applies to your provided examples, for instance with your link demo: https://www.slatejs.org/#/links

@afrankel-sfdo
Copy link

I can't even get the site to load in IE11 on Windows 10 or 8.1...

screen shot 2018-11-21 at 12 02 00 pm

@ericedem
Copy link
Contributor

@afrankel-sfdo Tracked here: #2385.

@afrankel-sfdo
Copy link

@eramdam thanks, that was just a sidebar while attempting to reproduce the editor issue in IE11 above.

@isubasti
Copy link
Contributor

isubasti commented Nov 29, 2018

Kinda find out what the issue is but don't know how to fix it. It's due to Edge and IE behaviour on contentEditable. If the Editor does not have focus then native selection's rangeCount is always 0( https://github.com/ianstormtaylor/slate/blob/master/packages/slate-react/src/plugins/after.js#L687 ). To verify this behaviour, make the Editor have autoFocus and go straight on clicking around the editor and it should works but once you clicked outside the editor and try to get back to it then you won't be able to select anything.

@epotockiy
Copy link

Fixed this by running editor.focus() without deselect() inside onFocus event in MS Edge, problem definitely are in new range selection, but i don't know how to fix it without removing function

statianzo added a commit to statianzo/slate that referenced this issue Jan 14, 2019
In IE11, refocusing by click would cause the editor to immediately lose focus.

Fixes ianstormtaylor#2364
@statianzo
Copy link
Contributor

I've create a PR that removes deselect for IE in #2535. It solved the issue for me. Can others check it out?

sbezludny pushed a commit to sbezludny/slate that referenced this issue Jan 22, 2019
In IE11, refocusing by click would cause the editor to immediately lose focus.

Fixes ianstormtaylor#2364
sbezludny pushed a commit to contentful/slate that referenced this issue Jan 23, 2019
In IE11, refocusing by click would cause the editor to immediately lose focus.

Fixes ianstormtaylor#2364
ianstormtaylor pushed a commit that referenced this issue Jan 30, 2019
* Fix mouse focus in IE 11

In IE11, refocusing by click would cause the editor to immediately lose focus.

Fixes #2364

* Skip delect onFocus for EDGE
davidnus pushed a commit to davidnus/slate that referenced this issue Feb 11, 2019
* Fix mouse focus in IE 11

In IE11, refocusing by click would cause the editor to immediately lose focus.

Fixes ianstormtaylor#2364

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

Successfully merging a pull request may close this issue.

8 participants