ckeditor / ckeditor4

The best enterprise-grade WYSIWYG editor. Fully customizable with countless features and plugins.
https://ckeditor.com/ckeditor-4
Other
5.8k stars 2.48k forks source link

Fix pasting (paste/paste plain text/paste from word) experience for mobile browsers #595

Closed stalker780 closed 6 years ago

stalker780 commented 7 years ago

CKEditor's 4.7 plain text paste is broken in Android Firefox and Chrome. It is used not often, but sometimes it is very handy to paste & edit texts from tablet. But in 4.7 paste from clipboard doesn't work at all.

When trying to paste via toolbar icon or editor menu I get "Your browser doesn't allow you to paste this way. Press CTRL+V/CTRL+SHIFT+V to paste" message.

Maybe it is possible to leave old paste dialog as optional plugin? Cause in CKEditor 4.6.3 all types of paste worked fine in mobile and desktop browsers. Seems you fixed a thing that was not broken :)

andrewpurkett commented 7 years ago

Would also like to see this available, as right now we have to retrain 1000s of people on this behavior, or revert CKEditor

gerasimnj commented 7 years ago

Same here! I am surprised that not many people complaining. We use "Past from Word" everyday and now we lost this valuable tool. Please resolve! Pretty please! :)

mlewand commented 7 years ago

Thanks for the feedback, we'll take a look at it on mobile. We need to see what can be done to make current behavior work on mobile.

We certainly don't want to fallback to the old dialog in CKEditor as it was cumbersome in terms of UX. At the same time we still the current solution is not the best, as normally one would like to be able to paste just by clicking toolbar button - but browsers doesn't allow us to do this that way (due to security concerns).

Anyway, as a part of this ticket we'll do a research on how we can improve it for mobile environments.

john-everden commented 7 years ago

It would be nice at minimum to allow the old plugin to be installed until this issue is resolved.

NorHei commented 7 years ago

I have tons of complains from my clients , the only option is to downgrade to older CKE. Besides from many clients using mobile devices, normal people won't remember all those funny key combinations . Most office users do not even remember CTRL-C and CTRL-V .

You really ruined an important part of CKE, please restore it!

kovtunos commented 7 years ago

I cannot downgrade Ckeditor in Drupal core. Please restore this functionality.

Modii commented 7 years ago

I hope this is restored soon. I can't downgrade Ckeditor in Drupal core either and this tool was essential to many of my clients.

Moradnejad commented 7 years ago

My clients are complaining about this too. Should we downgrade or will you fix this soon?

stalker780 commented 7 years ago

Finally people started noticing it :) A problem is not only with mobile browsers but also with desktop.

Everybody liked the way it worked with a popup and got used to it for years.

A new functionality looks like reinventing a bicycle :)

stalker780 commented 7 years ago

People, who wished to use shortcuts, still could do that and hide paste buttons from toolbar.

Moradnejad commented 7 years ago

I found another issue. It seems that its cause are newer browsers and as it is stated in the issue below, CKEDITOR cannot do anything about it (or doesn't want to) :(

https://github.com/ckeditor/ckeditor-dev/issues/469

aharown17 commented 7 years ago

Both Paste-From-Word and Paste-as-Plain-Text work in ver. 4.6. If they can work in 4.6 in all my browsers, then lack of this functionality in 4.7 is a bug... or whatever the word would be for "intentional defect." I get that there are tradeoffs, but I literally do not have time to use CKeditor w/o the Paste From Word feature. Reverted to 4.6 on my sites.

nfplee commented 7 years ago

I've just had a client complain about this not working. The trouble now is when they paste from word it doesn't strip all unnecessary tags.

Modii commented 7 years ago

@kovtunos and others. If you are using drupal, update core to fix this issue. The ckeditor library has been downgraded to version 4.7.2 in core a few days ago.

https://www.drupal.org/project/drupal/releases/8.4.2

stalker780 commented 7 years ago

@Modii discussed problem is related to 4.7.0 and upper. Latest working version is 4.6.3.

RafaelLinux commented 7 years ago

As a workaround for this essential functionallity, why not to ask to user if TO CLEAN or NOT TO CLEAN the clipboard content before paste it after user press "Ctrl + V" ? (as TinyMCE does, for example)

mlewand commented 7 years ago

Thanks again for the feedback. Let's get this going.

Users on Android Chrome/FF are currently unable to paste, so we need to solve it.

We have two options here:

Revert Old Paste Dialog For Mobile

This one is a no-brainer: bring back the old, stylish paste dialog.

It's far away from optimal pasting experience, and it adds to already very complex clipboard handling.

However, given our Community feedback, that's the only feasible quick fix for that problem.

Allow Native Context Menu

In this case we should allow native context menu to be shown on mobile devices:

Native Chrome context menu

The problem is that currently our custom Context Menu is blocking it from showing.

And the blocker is that we can't get drop custom context menu easily, as context menu is used as the only way to present results from Table Tools or List Style plugin (see #1190), and we can't fix that without further delaying the release.

Another reason is backward compatibility, many third party solutions also uses context menu as the only way to expose certain features.

But then again, using native context menu is the proper solution here, however we can't implement it just yet (though we have some ideas for it in the future).

Conclusions

Having that said we're starting with the revert of old paste dialog. We'll definitely want to revisit this issue in the future, but for now the priority is to make it working for the mobile again.

mlewand commented 7 years ago

Unfortunately we need to move this issue to 4.9.0. Based on your feedback this issue is a high priority for us, and we need to be sure to make it right.

With 4.8.0 release, the time frame for such a risky change was just too short.

@Comandeer has already prepared an initial fix, though it still needs some polishing (#1229).

We'll keep this issue updated, and we'll provide with a link to nightly builds as soon as we have it there, so you can provide your early feedback before the actual release.

pau1phi11ips commented 6 years ago

@mlewand Thanks for the info. I'm using 4.8 and using the removePlugins option to disable contextmenu. Fortunately we don't need anything it is used for. Hope this helps others.

mlewand commented 6 years ago

@pau1phi11ips happy it works for you. In case if context menu is not mandatory, I believe that using native context menu (and removing paste buttons) is the best way to handle it on mobile 👍

Meanwhile we continue to work on bringing the possibility to enable old dialog for users that want it. As you can see another PR just landed, we'll keep the issue updated as the PRs get reviewed and we can share the results. Ofc people wanting to put their hands on hot stuff can already view PR branches right now - after all that's the beauty of open source 😉

luciomartinez commented 6 years ago

If it helps, to disable contextmenu (as @pau1phi11ips mentioned) on the latest version: editor.config.removePlugins = 'contextmenu,liststyle,tabletools,tableselection';

Modii commented 6 years ago

Is this pasting issue still set to be included in the 4.9.0 version (due 13th february)? And do you have any idea when it'll be a part of the Drupal module?

ghost commented 6 years ago

@luciomartinez That is a great solution! Worked for us! All plugins keep working, including the more demanding ones such as Codesnippet. Thanks !

Martin @ codeconuts.nl

mlewand commented 6 years ago

Just to provide an update to all subscribed to the issue:

tl;dr

Meaningful

We're back to reviewing the solutions proposed in #1355 and #1229 so that they can get into the upcoming 4.9.0 release.

We have launched CKEditor 4 previews, a service that allows you to preview CKEditor on our feature development branches without a need to install it (actually the main goal why we creates such preview system is this ticket and upcoming Easy Image plugin).

With that you could have a peek at and test the solution before it's released.

You can preview solution on http://ckeditor4-preview.ckeditor.com/t/595-1347/samples/index.html at any time, it's updated automatically. Feel free to share your feedback.

We'll keep this issue updated.

mlewand commented 6 years ago

Mobile pasting landed on the major branch and will be released in the upcoming 4.9.0 version. You can preview it at:

https://ckeditor4-preview.ckeditor.com/major/plugins/easyimage/samples/easyimage.html

So crowd favorite paste dialog is back in town. Paste dialog reverted in latest CKEditor for mobile

Note that at the time of writing lang entries other than en.js were not rebuilt, thus old message is displayed for other languages. This will be fixed for the release version.

We could say that the crowd favorite paste dialog is back in town.

Thanks for all the feedback.

stalker780 commented 6 years ago

@mlewand Great! Waiting for 4.9 release and it's availability in builder.

aik099 commented 6 years ago

On desktop browsers (Chrome/Firefox) I'm getting: Use Ctrl+V ... message when pressing Paste from Word toolbar button and nothing else happens. Using Ctrl+V won't produce equivalent results to ones created by pasting into modal window, that is missing now.

Works like a charm on CKEditor 4.2 release.

anacolautti commented 6 years ago

getting this issue in 4.9.2

stalker780 commented 6 years ago

I also don't see promised modal paste window in 4.9.2 Behavior is the same as in 4.7. At least at desktop.

mlewand commented 6 years ago

Fix pasting (paste/paste plain text/paste from word) experience for mobile browsers

@stalker780 @anacolautti this issue is for mobile environment only, as it was not possible to paste at all (with default IMEs). Pasting on a desktop is a separate issue.

manjit-webtech commented 6 years ago

Thanks Anton

DonWolli commented 6 years ago

Now its mid september .... this bug exists for more than one year ... when can we expect a solution?

RafaelLinux commented 6 years ago

I'm afraid we should look other solutions, unfortunately :(

DonWolli commented 6 years ago

RAFAEL: Are you writing as user oder ckeditor-developer? PasteFromWord is an elemantary feature!

RafaelLinux commented 6 years ago

I'm sorry, I'm writing as user that needs "Paste Without Format" (CTRL+SHIFT+V) basic feature. I don't need to preserve formats, but linefeeds and tables structures, so I think PasteFromWord plugin will not solve this requirement for me :(

bkosborne commented 6 years ago

After reading thru this issue, it seems the old paste dialog was brought back, but only for mobile. Is there currently a solution to make it available for larger desktop displays as well?

bkosborne commented 6 years ago

Ok I actually misunderstood. It turns out the functionality still works. When you have text from word in your clipboard, and you press the past from word button, you're prompted to use your keyboard to paste. After you do that, CKEditor performs the processing on the text.

david2020 commented 4 years ago

I have this error in wpf webbrowser control

yogesh-mali44 commented 3 years ago

Is the toolbar paste issue ever going to be fixed for desktops?

KellyRayaneM commented 2 years ago

version : 4.7.1

CKEDITOR.editorConfig = function( config ) { config.removePlugins = 'elementspath,contextmenu,liststyle,tabletools,tableselection'; };