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

Safari 9.1.x Not Performing ENTER Correctly #1119

Open
mikebronner opened this issue Jun 11, 2016 · 4 comments
Open

Safari 9.1.x Not Performing ENTER Correctly #1119

mikebronner opened this issue Jun 11, 2016 · 4 comments

Comments

@mikebronner
Copy link

Description

SHIFT- ENTER doesn't work as expected after pressing ENTER when in Safari.

Steps to reproduce

  1. Open in Safari.
  2. Type text in editable field.
  3. Hit SHIFT-ENTER in your text. (Do not hit ENTER just yet.)
  4. Observe that SHIFT-ENTER is working as expected.
  5. Hit ENTER.
  6. Observe that the cursor does not advance correctly.
  7. Continue typing.
  8. Hit SHIFT-ENTER and observe broken behavior.

Expected behavior:
SHIFT-ENTER adds a soft-return, moving the cursor to the next line.
ENTER starts a new paragraph, moving the cursor to the start of the new paragraph.

Actual behavior:

I am experiencing this as well in Safari 9.1.1 and 9.1.2. The behavior of SHIFT-ENTER vs ENTER is flawed (works fine in Chrome). If you start off pressing SHIFT-ENTER everything will be fine until you hit ENTER. That will add

<br>
<p><br></p>
<br>

directly after the spot you hit enter, and it won't push the cursor to the end, but just before the opening <p> tag. If you start typing or hit SHIFT-ENTER everything is hopelessly messed up.

However, if you don't type, but move the cursor to then end, SHIFT-ENTER will continue behaving as normal -- until you hit ENTER again. Rinse and repeat.

Hopefully this helps somewhat in troubleshooting the issue and maybe coming up with a script that attempts to fix Safari's ill behavior. :)

I think the code that is inserted is correct, but the problem appears that the cursor is not being advanced correctly.

Versions

  • medium-editor: 5.20.0
  • browser: Safari 9.1.1 and 9.1.2
  • OS: Max OS X.11.5
@kroko
Copy link

kroko commented Jul 13, 2016

Can confirm, that Shift+Enter on Safari 9.1.2 @ OSX 10.11.6 Beta produces <p> not <br>.

@nmielnik
Copy link
Member

@mikebronner @kroko can either of you confirm whether this happens with a plain <div contenteditable="true"> element without initializing medium-editor? If you could confirm that it could help us determine whether this is a bug introduced by medium-editor, or an issue with safari that medium-editor could attempt to help fix...

Thanks a ton for opening the issue and giving such fantastic details on the issue.

@yepecece
Copy link

Is there any news on the soft-return bug with Safari?

Thanks

@FrittenKeeZ
Copy link
Contributor

We're also experiencing this broken behaviour with Safari =/

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

No branches or pull requests

5 participants