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

Exception in Slate (RTE) when pressing enter or backspace #2789

Closed
kien5436 opened this issue Oct 6, 2020 · 2 comments
Closed

Exception in Slate (RTE) when pressing enter or backspace #2789

kien5436 opened this issue Oct 6, 2020 · 2 comments

Comments

@kien5436
Copy link

kien5436 commented Oct 6, 2020

I use slate (https://docs.slatejs.org/) with preact, all things in the latest version. The problem begins when I used preact hooks.
Slate provides rich text editor and comes from react. When used it with react, everything is ok, but when used preact, my app was crashed.
I think there is a problem with preact hooks
This problem only occurs in Firefox

Reproduction

Error screen:
image

Sandbox: https://codesandbox.io/s/youthful-boyd-z3l36

Steps to reproduce

Run the app, type something then press enter or backspace

Expected Behavior

The Slate editor adds new line or deletes characters

Actual Behavior

App is crashed

@marvinhagemeister marvinhagemeister changed the title Hooks not working properly Exception in Slate (RTE) when pressing enter or backspace Oct 6, 2020
@kien5436
Copy link
Author

kien5436 commented Oct 6, 2020

For the title, I've tested draft-js and the result is same. This is a hook problem.

@sventschui
Copy link
Member

This is not related to hooks but rather FF not implementing onBeforeInput but slate relying on it. React ships a rather incomplete polyfill that breaks with spellcheck/autocorrect.

I'll close this as a duplicate of #1422, have a look at the comment I just left there.

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

No branches or pull requests

2 participants