easy-markdown-editor icon indicating copy to clipboard operation
easy-markdown-editor copied to clipboard

Native spellcheck (nativeSpellcheck) doesn't work, has unnatural custom style, doesn't allow adding corrections to dictionary

Open FishieCat opened this issue 8 months ago • 3 comments

Leaving the options empty or adding spellChecker: false and nativeSpellchecker: true should

  1. make spelling mistakes appear as they would in any ol' normal textarea
  2. allow right clicking to add corrections to the browser spellchecker dictionary

EasyMDE doesn't. Unless this 2020 comment is still valid.

To Reproduce

Below is the code based on and tested at https://stackblitz.com/edit/easymde :

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>EasyMDE demo</title>
    <link
      rel="stylesheet"
      href="https://cdn.jsdelivr.net/npm/easymde/dist/easymde.min.css"
    />
    <script src="https://cdn.jsdelivr.net/npm/easymde/dist/easymde.min.js"></script>
  </head>

  <body>
    <textarea id="my-text-area">
A spellink mistake.
Blueb erry wh ine.
Astount ing..</textarea>
    <script>
      const easymde = new EasyMDE({
        
        // START INSERTING

        
        // END INSERTING
        element: document.getElementById('my-text-area'),
        sideBySideFullscreen: false
      });
    </script>
  </body>
</html>

Paste the above into https://stackblitz.com/edit/easymde and add a space to the text area to trigger the spell check.

Then add

        spellChecker: false,
        nativeSpellchecker: true,

to the INSERTING commented area and trigger spellcheck again.

Expected behavior

  1. I can add terms to the native spellchecker dictionary
  2. The default, familiar browser style marking of spelling mistakes is used

Both are visible in this ckeditor5 issue

Also here's a screenshot of both visible while writing this ticket:

vvvvvvvvvvvvvvvvSCREENSHOTvvvvvvvvvvvvvvvv Image ^^^^^^^^^^^^^SCREENSHOT^^^^^^^^^^^^^

Actual behavior

  1. Adding terms to dictionary via context menu when right clicking on typos is not being offered
  2. Nonstandard style to mark typos is used (pink background)

vvvvvvvvvvvvvvvvSCREENSHOTvvvvvvvvvvvvvvvv Image ^^^^^^^^^^^^^SCREENSHOT^^^^^^^^^^^^^

Version information

  • Current CDN version
  • Windows Chrome and Firefox

FishieCat avatar Apr 19 '25 14:04 FishieCat

I'm not sure if I didn't properly test this or whether the results are inconsistent. After seeing https://github.com/Ionaru/easy-markdown-editor/issues/586 I tried my example again. Adding

        spellChecker: false,
        nativeSpellchecker: true,

disables spellcheck completely.

If these are the default values, that doesn't seem to make sense. Adding inputStyle: 'textarea', doesn't fix it.

FishieCat avatar Apr 19 '25 14:04 FishieCat

For me it started working with

spellChecker: false,
nativeSpellchecker: true,
inputStyle: contenteditable,

Image

valentijnscholten avatar May 04 '25 14:05 valentijnscholten

Thank you @valentijnscholten (contenteditable has to be in quotes)

spellChecker: false,
nativeSpellchecker: true,
inputStyle: 'contenteditable',

Workaround in action

FishieCat avatar May 04 '25 21:05 FishieCat