standardnotes / simple-task-editor

[Moved to https://github.com/standardnotes/app]
GNU Affero General Public License v3.0
11 stars 20 forks source link

save temporary task a user is typing #7

Closed bryvin closed 5 years ago

bryvin commented 5 years ago

https://github.com/standardnotes/bounties/issues/8

Saves the text input of the "unsaved" task that the user has not hit 'enter' on yet to put into Open tasks

moughxyz commented 5 years ago

Nice work, will give this a run sometime this week.

moughxyz commented 5 years ago

Issue:

  1. Create new note
  2. Assign Simple Task Editor
  3. Type "bar" in task input area
  4. Press enter on keyboard

Result: New task "ba" is created (missing last letter)

Expected result: New task "bar" is created

If I navigate away from the note with "bar" in the pending input, come back, and press enter, the item is created correctly.

bryvin commented 5 years ago

You are correct, I just committed a fix for this. It was happening because I was setting the state in the actual component and also up in the parent. This lead to conflicting state depending on timing I guess.

I think this also fixed an issue where you could not backspace while creating a new task.

moughxyz commented 5 years ago

Merged, nice work. Btw, check out this bug I found with presave. Pretty cool bug :) https://github.com/sn-extensions/simple-task-editor/commit/cbf31721781ce07fe12604d28211559d70bb8984

bryvin commented 5 years ago

Oh interesting.. that does make sense. I'll keep that in mind, but how did you find that out lol

moughxyz commented 5 years ago

User found it. If you type "12345" in a consistent rhythm with about 250ms in between each keystroke in any editor with presave, the "5" will not save. This was the cause.