Problem/Motivation

On both a live project and on a simplytest.me empty site, when I enter incorrectly spelled text via the Chrome 57 browser, I see the word underlined with a red line.

The only trouble is, when I right-click to correct the spelling, I am presented with the ckeditor-driven cut/copy/paste options and not the native browsers menu so I cannot correct the spelling. The same effect happens whether I have cut/copy/paster buttons in the ckeditor or not.

example of native menu not being available

Proposed resolution

Investigate how to allow site-builder to choose the behaviour of CKEditor. Will it

  1. Display native SCAYT wavy red lines but show the CKE context menu (current behaviour)
  2. Disable native SCAYT completely and show the CKE context menu
  3. Display native SCAYT and show the native context menu

Remaining tasks

User interface changes

API changes

Data model changes

Comments

rachel_norfolk created an issue. See original summary.

rachel_norfolk’s picture

Just adding an old, possibly related, issue. Seems we turned on native SCAYT so we see the errors. It's just that we can't then correct them!

Being able to Command-right-click to get to the hidden native context menu might be possible for administrators but not something that can be taught to thousands of end users!

rachel_norfolk’s picture

rachel_norfolk’s picture

So, the current default ckeditor config is defined at http://cgit.drupalcode.org/drupal/tree/core/modules/ckeditor/src/Plugin/... with 'disableNativeSpellChecker' => FALSE,. What I think we need is to make this configurable through the UI.

wim leers’s picture

Category: Bug report » Feature request

It seems you've read #2307141: Enable browsers' (native) spell checker in CKEditor and the difficult weighing of choices we did there. There is no great choice, it's always choosing the lesser of two evils.

I don't see how making disableNativeSpellChecker configurable would help at all. It's set to FALSE so that at least you get the red underlining of incorrectly spelled words. If you change it to TRUE, then you won't even have that.

So, I'm afraid this is a case of Closed (works as designed), sadly :(

rachel_norfolk’s picture

So how about we add something to the compose tips to explain how to use the system as it stands? We can do that, at least?

As things stand right now, we might not have a perfect solution but it appears to the end user to be a bug. That’s how they are reporting it.

GrantHorizons’s picture

Currently I see ONLY "Paste ctrl-V" when I right click on a misspelled word. THAT is a BUG!!
(Win 10 Firefox 53)

IF you're going to show the user the red underline for misspelled words, and can't give them something that WORKS AS IT SHOULD, it's better to show the user NOTHING - in other words disable right-click, don't show them erroneous information/possibilities. OR tell them in a tooltip/right click something USEFUL like "ctrl or command right click to correct spelling".

Or DO NOT show the underlined misspelled words at all - in other words don't give them false hope.

Or make it work like it should!

liampower’s picture

+1 it isn't a great user experience to begin with for CMS users to have to use ctrl + right click, let alone end users.

ok_lyndsey’s picture

StatusFileSize
new11.55 KB

I agree that this behaviour is confusing, I have just thought it was a D8 bug.

I believe expected behaviour is that when an item is highlighted as misspelled by being underlined in red, a right mouse click will present spelling suggestions. This is the behaviour in CKEditor in D7 - and it's also the behaviour in this text box I'm typing this comment in now.

IMO it's an important part of usability and the editor experience which is important. Even reading through the comments here I'm unsure how I would explain the behaviour to a client if it is decided it's working as normal "the word is underlined in red because it's misspelled, go get a dictionary and figure it out"? :)

Screenshot of error and right mouse click:
misspelled word and behaviour on right mosue click showing cut and paste not spelling suggestions

wim leers’s picture

#6 + #8 + #9: that may very well be, but there's nothing we can do to fix this. It's a browser limitation. Drupal can't fix that.

#7: no need to be rude.

#9:

I believe expected behaviour is that when an item is highlighted as misspelled by being underlined in red, a right mouse click will present spelling suggestions.

This has never been an expectation for me. The underlining itself is sufficient for me: I'll fix it myself, because very often, the suggestions include lots of wrong suggestions too. So, for me, just the underlining is sufficient. And coincidentally, that's also as far as browser limitations will let CKEditor go.
Again, please read #2307141: Enable browsers' (native) spell checker in CKEditor for the full discussion. Specifically, see #2307141-6: Enable browsers' (native) spell checker in CKEditor.


We have to choose between either:

  • spell checking with only underlining, no right-click-to-correct, but DO retain the CKEditor context menu
  • spell checking with underlining and right-click-to-correct, but DO NOT retain the CKEditor context menu

There's no good choice.

I'm personally okay with removing the CKEditor context menu, so that this would become possible. But doing so would be a backwards-incompatible change.

If it'd help, I'm happy to create a Drupal 8 contrib module that disables the CKEditor context menu, so that you can use the native context menu, and hence do get spelling/grammar corrections.

But do note that this was discussed at length in #2307141: Enable browsers' (native) spell checker in CKEditor

rachel_norfolk’s picture

So, what it seems is some of us (both site-builders and end-users) have a different understanding to that of the original issue. That’s fair enough and can happen.

How about as an option we leave this issue open for a time, not to change the decision already made but to investigate whether it is possible to create a way to easily allow the default behaviour to be changed?

I’m prepared to look into that.

Would that be reasonable?

wim leers’s picture

Of course! :)

wim leers’s picture

Title: Correcting spelling via native right-click in ckeditor enabled rich text fields seems impossible » Correcting spelling via native right-click context menu in CKEditor-enabled text fields is impossible
Category: Feature request » Plan
Issue tags: +Needs usability review

Reflecting #11.

ok_lyndsey’s picture

Thanks Wim - apologies for going over old ground. I work with not for profits and government so they get hung up on stuff like this, and worse they add it to long lists of requirements that rule a tender out.

Interested in where the govcms people in Australia go with this - they should have need for restricted ckeditor + spell check. I'm thinking the D8 contrib module is probably a good idea.

Agree with Rachel that leaving this open is worth it, also for ease of identifying how there is an issue. The Enable browsers' (native) spell checker in CKEditor task is great and comprehensive but long.

mlewand’s picture

Just to put my two cents: there are two most reasonable ways to go either use SCAYT with CKEditor's custom context menu or you can go with native spellcheck and native context menu.

Going without a possibility to correct typo from a context would be an annoyance for certain group of end users.

I'd suggest going for going SCAYT + custom context menu. SCAYT integrates well with CKE (undo and whatnot), provides the same cross-browser experience.

Also dropping custom context menu will result with users not being able to use tabletools plugin utility, which ATM is the only way to access certain features, such as drop a column etc. It's a flaw that we want to fix in future releases, but that's how it works now.

Having above in mind I'd go with SCAYT now, and revisit it in year or two to see if target browsers have provided APIs for context menu customization.

wim leers’s picture

SCAYT (http://ckeditor.com/addon/scayt) is not an option, because it depends on a 3rd party service.

rachel_norfolk’s picture

Agreed - the scope of this issue will only be to examine if it is possible to allow site builders to choose

  1. whether the CKE behaviour allows native SCAYT,
  2. whether right-click shows CKE or native context menus

or neither of these options.

rachel_norfolk’s picture

Issue summary: View changes

Updated Issue Summary to reflect this.

diamondsea’s picture

I needed an immediate solution for some of my clients, so I created a project that disables the contextmenu, tabletools, and tableresize plugins via a tiny module:

https://www.drupal.org/project/ckeditor_browser_context_menu

I would love for this to be a customizable option in the CKEditor module itself.

Bojhan’s picture

Issue tags: -Needs usability review

Lets leave this issue open, but I am also keen on not fixing a standard CKE behaviour unless we solve it on the editor level itself.

wim leers’s picture

Issue tags: +Needs upstream bugfix

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

wim leers’s picture

Title: Correcting spelling via native right-click context menu in CKEditor-enabled text fields is impossible » [upstream] Correcting spelling via native right-click context menu in CKEditor-enabled text fields is impossible
Status: Active » Postponed
mlewand’s picture

In case you can't use SCAYT, then your only option (keeping spell check) is to use native context menu.

CKEditor has no way to manipulate browser spell checking (no API), so this function can only be manipulated only using native context menu.

There's a feature in CKE4 (enabled by default) that ctrl/cmd+click gives you a native context menu (see "Using Native Browser Spell Checker" in https://sdk.ckeditor.com/samples/spellchecker.html).

wim leers’s picture

Issue tags: +browser

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

pawel_r’s picture

#19 Thank you diamondsea, great workaround!

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.2.x-dev

Drupal 8 is end-of-life as of November 17, 2021. There will not be further changes made to Drupal 8. Bugfixes are now made to the 9.3.x and higher branches only. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.15 was released on June 1st, 2022 and is the final full bugfix release for the Drupal 9.3.x series. Drupal 9.3.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.4.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

quietone’s picture

Project: Drupal core » CKEditor 4 - WYSIWYG HTML editor
Version: 9.4.x-dev » 1.0.x-dev
Component: ckeditor.module » Code

CKEditor has been removed from core, CKEditor 4 is removed from Drupal Core in 10.0.0