-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Description
Description
SHIFT- ENTER doesn't work as expected after pressing ENTER when in Safari.
Steps to reproduce
- Open in Safari.
- Type text in editable field.
- Hit SHIFT-ENTER in your text. (Do not hit ENTER just yet.)
- Observe that SHIFT-ENTER is working as expected.
- Hit ENTER.
- Observe that the cursor does not advance correctly.
- Continue typing.
- 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