Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration with Grammarly #449

Closed
oyeanuj opened this issue Nov 23, 2016 · 11 comments
Closed

Integration with Grammarly #449

oyeanuj opened this issue Nov 23, 2016 · 11 comments
Labels

Comments

@oyeanuj
Copy link
Contributor

oyeanuj commented Nov 23, 2016

Hey @ianstormtaylor! Playing with Grammarly plugin alongside Slate, I am seeing issues where Grammarly extension is unable to update text in the editor. It is easily reproducible on the examples.

I haven't had the chance to investigate much further yet, but I wanted to create an issue incase anyone else here already knew what was going on..

@ianstormtaylor
Copy link
Owner

I think Grammarly tries to manually edit the DOM state? That's probably going to cause issues with React if so, but I haven't investigated it at all personally. But we can see if others have experience and can chime in!

@oyeanuj
Copy link
Contributor Author

oyeanuj commented Nov 23, 2016

Yep, seems like it. Did a little bit of digging around and found that Draft also has issues with Grammarly: facebookarchive/draft-js#616 cc: @kigorw (Grammarly dev)

@kigorw
Copy link

kigorw commented Nov 23, 2016

Thanks, we are thinking how to fit this issues into our roadmap.

@oyeanuj
Copy link
Contributor Author

oyeanuj commented Nov 24, 2016

Thanks for the update @kigorw!

In the meantime, I'll try to get to integrate @Soreine & @SamyPesse's Rousseau library with Slate as an alternative.

@Soreine @SamyPesse, if you have already done it or plan to, do drop a note here since you both know those libraries the best!

@ianstormtaylor
Copy link
Owner

Going to close since there's nothing actionable here for now for Slate, but feel free to keep discussing grammar checkers!

@isubasti
Copy link
Contributor

facebookarchive/draft-js#616, hopefully grammarly release a version that use document.execCommand pretty soon. then we can start improving onInput that still seems to be a problem especially for IME. on the other note, I notice that tools such as https://languagetool.org/ and https://www.scribens.com/# breaks slate as well and no obvious way on how to turn this off all together programmatically

@oyeanuj
Copy link
Contributor Author

oyeanuj commented Aug 22, 2018

@kigorw @blacktaxi Any updates on using Grammarly playing well with Slate?

@blacktaxi
Copy link

Hi @oyeanuj,

Slate is definitely on our radar, but is not in our immediate plans to support. Nevertheless, I've just ran a quick test of the new Grammarly, and while underlining works fine, the text modification through document.execCommand doesn't. It looks like the Slate editor might be misinterpreting input from execCommand, as the changes made by this call are reverted back once you type something with your keyboard.

@linonetwo
Copy link
Contributor

Grammarly will cause CPU 100% on https://new-japanese-concise-tutorial-interactive-oezqwptftx.now.sh/ and not responding, on firefox and chrome.
Turn off Grammarly then page works fine.

The source code of that site is https://github.com/linonetwo/new-japanese-concise-tutorial-interactive

@nadeemshaik
Copy link
Contributor

I am not sure about the CPU usage issue but I tried enabling Grammarly on my local build (slate-react #733) and with the latest version Grammarly changes are triggering the change event and things seem to be working fine. Am I missing something here?

Also, @ianstormtaylor will it be possible to update the code in order to let users override the data-gramm flag if necessary. Under the current implementation, there is no way one can enable Grammarly at all.

@rikkit
Copy link

rikkit commented Nov 4, 2019

@nadeemshaik I've done a bit of testing - basically the "inline mode" works, but the "overlay mode" breaks Slate. I'm not sure why one works and the other doesn't since Grammarly is modifying the DOM directly in both cases. Possibly something to do with a difference in updating a text node vs the whole editor?

Repros

Inline mode - works as expected

  1. Add data-gramm="true" to the editor
  2. Paste in this text:

    Twelve billion miles from Earth, there is an elusive boundary that marks the edge of the sun’s realm and the start of interstellar space. Voyager 2, the longest running space mission, has finally beamed back a faint signal from the other side of that frontier, 42 years after its launch.

  3. Grammarly should underline "longest running":
    image
  4. Click "longest-running" in the tooltip
  5. The text should change as expected.
  6. The editor continues to be editable.

Overlay mode - broken

  1. Hover over the bottom right menu
  2. Click on the "open in fullscreen" button image
  3. Make any changes you want to make, then close.

E: Text is updated and continues to be editable.
A: Text appears to be updated, but cannot be modified. Slate appears to be "frozen"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

8 participants