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

Disallow typing space if it's the first character #43

Open
ryankupk opened this issue Apr 4, 2024 · 2 comments
Open

Disallow typing space if it's the first character #43

ryankupk opened this issue Apr 4, 2024 · 2 comments

Comments

@ryankupk
Copy link

ryankupk commented Apr 4, 2024

I tend to always press space after every word during normal typing, or after each ngram while using this site, and after completing an ngram when the cursor automatically resets I tend to press space by default. When doing this, after the end of the last ngram, you'll incorrectly enter a space at the start of the next set. This isn't necessarily a behavior that I think should be disincentivized, so I propose disallowing space being entered if it's the first character.

@mart-e
Copy link

mart-e commented Apr 19, 2024

but it’s already ignored isn’t it?

ngram-type/app.js

Lines 187 to 190 in b31347e

// Remove the spaces at start of the typed phrase
// since the user might have a typing break
// but have a habit of typing the spacebar before pausing the session.
var typedPhrase = this.typedPhrase.trimStart();

@ryankupk
Copy link
Author

but it’s already ignored isn’t it?

ngram-type/app.js

Lines 187 to 190 in b31347e

// Remove the spaces at start of the typed phrase
// since the user might have a typing break
// but have a habit of typing the spacebar before pausing the session.
var typedPhrase = this.typedPhrase.trimStart();

Sort of. I believe that space will start the wpm timer, so while leading spaces are stripped to check correctness and ignored in that sense, it impacts the wpm. It's also a poor/unclear UX: 1000 leading spaces is the same as 1 leading space which is the same as 0 leading spaces.

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

No branches or pull requests

2 participants