ckeditor / ckeditor5

Powerful rich text editor framework with a modular architecture, modern integrations, and features like collaborative editing.
https://ckeditor.com/ckeditor-5
Other
8.71k stars 3.62k forks source link

Mac Text Replacement Shortcuts Don't Work In Safari #13428

Open slotterbackW opened 1 year ago

slotterbackW commented 1 year ago

πŸ“ Provide detailed reproduction steps (if any)

  1. On MacOS create a text replacement shortcut (System Preferences > Keyboard > Text). In this example I created one where the text is "omw" and the replacement is "On my way!". Screen Shot 2023-02-07 at 5 15 58 PM

  2. Open the CKEditor Classic editor demo page in Safari or Firefox: https://ckeditor.com/docs/ckeditor5/latest/examples/builds/classic-editor.html

  3. Type "omw"

βœ”οΈ Expected result

The text is highlighted and the replacement text appears:

Screen Shot 2023-02-07 at 5 14 11 PM

Upon pressing a key the replacement text is inserted instead of the original text

Screen Shot 2023-02-07 at 5 15 03 PM

❌ Actual result

No replacement text appears:

Screen Shot 2023-02-07 at 5 14 56 PM

πŸ“ƒ Other details


If you'd like to see this fixed sooner, add a πŸ‘ reaction to this post.

jabeler commented 1 year ago

This also affects spelling autocorrect in Safari.

Any news on a potential fix?

semireg commented 1 year ago

This issue is really killing the ZenDesk ticket experience. I highly rely on text replacements for my day-to-day. Any help is very much appreciated.

DylanCDouglas commented 1 year ago

Even without text replacements, having to remember to spellcheck manually has resulted in several mistakes going out. Please fix this as soon as possible.

Witoso commented 1 year ago

Thank you for bringing this to our attention, and sorry for the bad experience. We will try to prioritize it but keep in mind that our pipeline is limited. Although I know it's not always an option, this works on other browsers and may be a temporal workaround.

macitpros commented 1 year ago

Ditto to @semireg and @DylanCDouglas comments. A fix would be greatly appreciated.

pixelsurium commented 1 year ago

We upgraded our site from Drupal 8 to Drupal 9 and theres the new CKeditor 5 included, now the text replacement dont work for our users anymore. Not only in Safari in Firefox it doesnt works too!

Witoso commented 1 year ago

@pixelsurium thanks for the report, I confirm that it doesn't work on Firefox as well.

niegowski commented 1 year ago

Safari seems to block text replacement if the beforeinput event is canceled. We block them so we can control where exactly the typed text should land (for example writing on the edge of a link):

https://github.com/ckeditor/ckeditor5/blob/3773e9037d9f43d76a1316552c9fe5fab595d34f/packages/ckeditor5-typing/src/input.ts#L51

We might consider modifying this behavior so that characters are not typed twice and the mutation observer is not fixing text after every letter typed. Maybe we could use some hybrid typing that would allow default browser behavior in safe cases and use custom one in edge cases that would otherwise require fixing text. This looks like a huge task. Interesting that it works just OK in Chrome.

For the Firefox... it looks like the browser itself does not support text replacement provided by Mac OS.

Witoso commented 1 year ago

Confirming, Firefox on MacOS doesn't support text shortcuts. Rel: https://connect.mozilla.org/t5/ideas/support-macos-text-replacement/idi-p/15219

eduard-co commented 10 months ago

Wanted to say thank you for breaking the whole experience for all products that use this editor. No text replacement or auto correct since January since this bug has been reported. This is awesome!

Excuses and excuses and excuses, and shitty workarounds. You guys rock! πŸ–•

jabeler commented 8 months ago

Is there any movement on finding a workable solution here?

Safari has ~20% overall market share across all platforms, and this of course will be much higher among macOS users (which represent ~30% of the overall desktop market). Suffice to say, this issue affects a substantial segment of CKEditor users.

From @niegowski's notes above, it looks like it would take a fair amount of work. However, I believe this is worth digging into and finding a solution for.

Thanks for your efforts!

Witoso commented 8 months ago

Thank you for your comment and the bump! It's on our list of things to investigate. I judge the impact a bit differently, although Safari is the top of the browsers, I still think the text replacements is a power feature for 1% of users. It may be different depending on the use case.

I checked other web editors, 5/6 didn't work as well (in Safari). The issue touches the core of our editor's implementation, we cannot easily if this, as we would most likely broke typing/IME's work.

One thing that we should do, is to file the issue to the Safari. @niegowski let's sync on that.

Witoso commented 7 months ago

Reported to Safari support.

jabeler commented 7 months ago

@Witoso I can appreciate that, but I guess what hasn’t been mentioned here is in addition to breaking text replacements (which I agree can be a power user feature) it also breaks the predictive text feature on macOS which is probably used by many more people.

AFAIK, predictive text isn’t supported in other browser such as Chrome, so Safari is the only option for this.

Screenshot 2023-11-26 at 7 35 49β€―AM