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

Shift enter not inserting <br>'s in Safari #13321

Closed
DEfusion opened this issue Jan 23, 2023 · 4 comments · Fixed by #13797
Closed

Shift enter not inserting <br>'s in Safari #13321

DEfusion opened this issue Jan 23, 2023 · 4 comments · Fixed by #13797
Assignees
Labels
domain:typing/ime This issue reports a problem with standard typing & IME (typing method for CJK languages). package:typing squad:core Issue to be handled by the Core team. type:bug This issue reports a buggy (incorrect) behavior. type:regression This issue reports a bug that was not present in the previous releases.

Comments

@DEfusion
Copy link

📝 Provide detailed reproduction steps (if any)

  1. Goto the feature rich editor example in Safari & another browser
  2. Remove all content
  3. Type something
  4. Press shift and enter a few times:

✔️ Expected result

In Chrome you get the expected <br>s

<p data-placeholder="Type or paste your content here!">Something<br><br><br><br><br><br><br><br data-cke-filler="true"></p>

❌ Actual result

In Safari you get multiple <p>s

<p data-placeholder="Type or paste your content here!">Something</p><p><br data-cke-filler="true"></p><p><br data-cke-filler="true"></p><p><br data-cke-filler="true"></p><p><br data-cke-filler="true"></p><p><br data-cke-filler="true"></p><p><br data-cke-filler="true"></p><p><br data-cke-filler="true"></p><p><br data-cke-filler="true"></p>

📃 Other details

  • Browser: Safari 15.6.1 (OSX), Chrome 109.0.5414.87 (OSX)

If you'd like to see this fixed sooner, add a 👍 reaction to this post.

@DEfusion DEfusion added the type:bug This issue reports a buggy (incorrect) behavior. label Jan 23, 2023
@DEfusion
Copy link
Author

Started digging, but I can't track down the origin of the problem.

At KeyObserver#onDomEvent it detects the shift key correctly.

At InputObserver beforeInput in chrome it gets an insertLineBreak inputType, in Safari it is insertParagraph

At EnterObserver beforeinput has same inputType as above in each browser.

@Reinmar
Copy link
Member

Reinmar commented Jan 24, 2023

At InputObserver beforeInput in chrome it gets an insertLineBreak inputType, in Safari it is insertParagraph

That's the origin. Safari fires a wrong event. I remember it doing this in some case but I don't remember what we did about this. I'm afraid we may need to be listening to Shift key too and if we see it's pressed, turn insertParagraph into inputType. cc @niegowski

@Reinmar Reinmar added package:typing domain:typing/ime This issue reports a problem with standard typing & IME (typing method for CJK languages). squad:core Issue to be handled by the Core team. labels Jan 24, 2023
@Reinmar Reinmar added the type:regression This issue reports a bug that was not present in the previous releases. label Mar 8, 2023
@Witoso Witoso self-assigned this Mar 27, 2023
@CKEditorBot CKEditorBot added the status:planned Set automatically when an issue lands in the "Sprint backlog" column. We will be working on it soon. label Mar 27, 2023
@Witoso Witoso assigned mremiszewski and unassigned Witoso Mar 27, 2023
@CKEditorBot CKEditorBot added status:in-progress Set automatically when an issue lands in the "In progress" column. We are working on it. status:planned Set automatically when an issue lands in the "Sprint backlog" column. We will be working on it soon. and removed status:planned Set automatically when an issue lands in the "Sprint backlog" column. We will be working on it soon. status:in-progress Set automatically when an issue lands in the "In progress" column. We are working on it. labels Mar 28, 2023
@mremiszewski
Copy link
Contributor

Cannot reproduce on Windows using either Maxthon or Midori browsers. Someone with Apple should take this.

@mremiszewski mremiszewski removed their assignment Mar 28, 2023
@Reinmar
Copy link
Member

Reinmar commented Mar 29, 2023

Just checked it's still reproducible on Version 16.1 (18614.2.9.1.12).

@niegowski niegowski self-assigned this Mar 30, 2023
@CKEditorBot CKEditorBot added status:in-progress Set automatically when an issue lands in the "In progress" column. We are working on it. and removed status:planned Set automatically when an issue lands in the "Sprint backlog" column. We will be working on it soon. labels Mar 30, 2023
arkflpc added a commit that referenced this issue Apr 3, 2023
Fix (enter): Pressing Shift+Enter in Safari should insert <br> instead of splitting block. Closes #13321.
@CKEditorBot CKEditorBot removed the status:in-progress Set automatically when an issue lands in the "In progress" column. We are working on it. label Apr 3, 2023
@CKEditorBot CKEditorBot added this to the iteration 62 milestone Apr 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:typing/ime This issue reports a problem with standard typing & IME (typing method for CJK languages). package:typing squad:core Issue to be handled by the Core team. type:bug This issue reports a buggy (incorrect) behavior. type:regression This issue reports a bug that was not present in the previous releases.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants