Comments (12)
I think we can't copy the exact behavior of the in-built spell checker. The best we can do is not to spell check the word under the cursor or near the cursor.
from fin-spell.
Yeah, but I think that should be enough. At least we'll get rid of the immediately highlighting of the words that I'm still typing :)
from fin-spell.
Well, that was easy if it works now. I pushed a commit to the same branch.
from fin-spell.
Ok, I just compiled the new version and the initial tests are looking good! I'll try to write some more if any issues are found...
from fin-spell.
I think it works mostly now. But there is a case if I change (mistype) the word and move the cursor away it won't trigger the spell checking. I have to hit enter or put space or something else to trigger the spell checking. I made a screen record about the issue (it's easier to see what I mean from there):
https://user-images.githubusercontent.com/11405096/105880229-cb7ff700-600b-11eb-98a2-a97ce7aae0ab.mp4
from fin-spell.
I have to add handler for click events to change that. Seems like it's an easy fix and I don't see anything negative happening if I do that.
from fin-spell.
The same thing happens if you move the cursor with keyboard, so click event handler doesn't solve this entirely.
from fin-spell.
Using a keydown event, for example, solves this but then the text isn't spell checked when you paste text with a mouse. Pasting with a mouse doesn't dispatch click event. And we can't have a listener for an input and a key* events because then text is spell checked twice. Looks like we have to choose what to support. Which one you would like to have?
from fin-spell.
Hmm, OK I undestand. I assume there is no possibility to listen changes of the textarea/input value / its content somehow?
from fin-spell.
I take that back. There's a paste event, so I think changing input to keyup and adding click and paste event handlers the text is spell checked in every case. So we don't have to choose.
from fin-spell.
Every corner case should now be covered in the newest commit.
from fin-spell.
Yes, I agree with you. I think it's perfect now (or at least all my test cases were working just fine). Thanks!
I think this issue / feature request can be closed if you want to? I can confirm that this functionality is added and tested, thanks!
from fin-spell.
Related Issues (11)
- User set highlighting isn't used in sidebar
- div role="textbox" elements are not spell checked HOT 5
- Start using manifest v3 API
- Set spellcheck to false in the edited element HOT 1
- Don't highlight the whole text on every key press HOT 5
- emsdk version in readme isn't found anymore as a precompiled package HOT 1
- Enlarge the textarea to always fill the sidebar HOT 2
- Read the word under mouse pointer when opening context menu without left mouse click
- Add option to enable/disable the spell checking by default HOT 9
- Add Päälle/Pois functionality in Firefox context menu HOT 12
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fin-spell.