Skip to content

Built-in spellchecker on mac, params.dictionarySuggestions always empty array #24455

Closed as not planned

Description

@eugene-pr

Preflight Checklist

  • I have read the Contributing Guidelines for this project.
  • I agree to follow the Code of Conduct that this project adheres to.
  • I have searched the issue tracker for an issue that matches the one I want to file, without success.

Issue Details

  • Electron Version:
    • 9.1.0
  • Operating System:
    • macOS Mojave 10.14.6
  • Last Known Working Electron version:

Expected Behavior

On context-menu event, params.dictionarySugestions should be an array of suggested words for a misspelled word.

Actual Behavior

params.dictionarySugestions always return an empty array

To Reproduce

  1. install electron-quick-start
  2. set spellcheck:true in webPreferences
  3. Add textarea to the index.html
  4. Add context-menu listener to the created browserWindow.webContents

Screenshots

image

  • Screenshot from the Notes.app, you can see a list of suggestions for the misspelled word "twer".
    image

Additional Information

Activity

  1. EtienneLem commented on Jul 10, 2020

    @EtienneLem

    FWIW; Tried all the versions from 9.1.0 to 8.0.0 and I could never* get any suggestions.

    * Actually, the first time I tried 8.0.0 I did get suggestions. Then tried a more recent version and since then 8.0.0 has stopped giving me suggestions as well. 🤷

    I also noticed that ses.getSpellCheckerLanguages returns ['ru'] even though I haven’t set Russian in my system languages. It returns ['en-US'] if I set it although it’s advertised as being no-op on macOS. Suggestions always empty regardless of this.

    Just in case this could give some pointers.

  2. MarshallOfSound commented on Aug 12, 2020

    @MarshallOfSound
    Member

    What is your spelling language set to in system preferences?

    image

  3. eugene-pr commented on Aug 13, 2020

    @eugene-pr
    Author

    This is my spelling language set

    image

  4. MarshallOfSound commented on Aug 13, 2020

    @MarshallOfSound
    Member

    @eugene-pr If you change "Spelling" from "Automatic by Language" to your preferred language can you see if the spellchecker works?

  5. eugene-pr commented on Aug 16, 2020

    @eugene-pr
    Author

    @MarshallOfSound , same behavior.

    image

  6. EtienneLem commented on Aug 26, 2020

    @EtienneLem

    On my end changing Spelling from Automatic to a language did work (after restarting electron). And now even when setting Spelling back to Automatic I do get suggestions. I also made sure I would still get suggestions after rebooting, I do. I also tried to re-install the native dependency (atom/node-spellchecker), electron-rebuild and go back to the new built-in spellchecker (without native dependencies), I still get suggestions.

    Looks like suggestions always work now. I’m just not 100% sure I can trust that it will be the case for all our users on macOS. Having to ask them to go through the changing Spelling setting steps would be a bit of a blocker.

  7. eugene-pr commented on Aug 26, 2020

    @eugene-pr
    Author

    It seems that it's also working for me now. But it didn't work after restarting electron, then I rebooted my laptop and it does work. Also If it can help, chrome browser also did not show any spellcheck suggestions before and now it does. Unfortunately can't reproduce it back to not working.

  8. EtienneLem commented on Aug 26, 2020

    @EtienneLem

    Interesting. Now that you mention it, I remember not having suggestions on Chrome and now I do.

  9. aabuhijleh commented on Nov 4, 2020

    @aabuhijleh

    I can reproduce this reliably in Electron 9.3.0 on macOS Catalina in my application

    • When Spelling = "Automatic by language"

    Screen Shot 2020-11-04 at 8 56 45 PM

    Screen Shot 2020-11-04 at 8 57 03 PM

    • When Spelling = "U.S. English" + restarting the app

    Screen Shot 2020-11-04 at 8 58 20 PM

    If I change the setting back to automatic (and restart the app), the same issue will happen

    Google Chrome spell checking was fine in both cases

    From my testing, it seems that Electron spell checking on macOS will be very inconsistent unless the language to be spell checked is explicitly defined in system preferences

    Of course, most users will have the default preference "automatic", so this is a big problem for us. Can anyone please suggest a workaround?

  10. aabuhijleh commented on Dec 6, 2020

    @aabuhijleh

    Any updates on this issue?

  11. benjaminfrombe commented on Jan 14, 2021

    @benjaminfrombe

    +1

    still having to change languages manually everytime I change language ...

  12. github-actions commented on Oct 7, 2022

    @github-actions
    Contributor

    This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment!

  13. github-actions commented on Nov 7, 2022

    @github-actions
    Contributor

    This issue has been closed due to inactivity, and will not be monitored. If this is a bug and you can reproduce this issue on a supported version of Electron please open a new issue and include instructions for reproducing the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions