-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Soft breaks not detected in macOS Safari #5500
Comments
I don't think it is a bug of slate. Please check this demo out: https://developer.mozilla.org/en-US/docs/Web/API/InputEvent/inputType . The behaviour is as same as your demo. And, the "is-hotkey" lib seems only to be using under no HAS_BEFORE_INPUT_SUPPORT env. Enters are handled here:
I suppose that there could be a new feature like checking the shift key's status in some ways if you wanna separate line breaks in safari |
Thanks for your reply, @frellica. It looks like you are correct, I wasn't looking deep enough. For whatever reason Safari has designated control+return for the insertLineBreak event type. I may end up making a special rule for this, since our users expect shift + return to produce a line break, but it doesn't seem like something that Slate should need to account for. |
Description
Soft breaks (shift + enter) are interpreted as hard breaks in Safari. They are detected correctly in Chrome. I tested the 'is-hotkey' library and 'shift+enter' works fine in Safari, so the bug must be somewhere in the Slate library. If no one has any ideas I can dig deeper and attempt to identify the issue.
Sandbox
https://codesandbox.io/s/slate-reproductions-forked-kxss7c?file=/index.tsx
Steps
To reproduce the behavior:
Expectation
Soft breaks should be detected in Safari as they are in Chrome.
Environment
Context
One of the requirements for my editor is that hard and soft breaks are treated differently (double space vs single space)
The text was updated successfully, but these errors were encountered: