by alfonsodev · 5y ago · 0 comments
I had this bug trying to implement a text editor using Draft.js but not sure it was for the same reason.
I guess tumblr devs tried to implement a text editor and at the same time have some vim like shortcuts(jkl).
This makes you appreciate how less can be more.
For example, earlier today I was editing a small internal app in Retool. I typed something, instinctively went for Cmd-Z, and it reverts a bunch of changes I made in the query I had open 5 minutes ago. Of course, by the time I spot it and hit Shift-Cmd-Z, the internal state has updated so now it redoes some other unrelated undo operation and I have two broken things to fix.
And then of course there's Notion, the champion of "you've hit a keyboard shortcut and it's applied it to something halfway across the screen from the selection, or possibly just given up trying to do anything useful and deleted a few paragraphs of text at random". Perhaps they were pining for the outrageously janky experience that was attempting to make even the most innocuous of formatting changes in earlier versions of Word For Windows.
If I accidentally fat-fingered e.g. the \ key at the end of a message ("Got it!\"), I want to
1. press the up key
2. press backspace
3. press enter
to delete the last character in the last sent message.
But unless you actually wait at least a second after step 1, the UI is so sluggish in starting the edit of your last message that you instead get "please type a message to continue" because you pressed enter while the New Message text box still had focus.
Things are much worse if you want to do anything more complex. Say, capitalize the first letter of the last sent message (up, home, delete, type capital letter, enter). Usually results in complete gibberish, like appending the capital letter to the message, or sending it in a new message (depending on how fast you are).
How does VSCode handle this? Because I’ve never had an issue typing on it, I’ll definitively have a look to the repo, but does someone know?
on'tD do this.
I had written a comment with multiple paragraphs (which I guess they don't expect people to do, or test for) and I wanted to add something to the next-to-last paragraph, and when I tried to type "matters" it would keep locking me in autocomplete tagging for friends name "Matthew", and as soon as I dismissed the cursor would leap to the end of the comment. If I tried to click back, the cursor kept jumping to the end!
I did try copy/pasting from another program, but formatting bugs made that unreliable.