joplin icon indicating copy to clipboard operation
joplin copied to clipboard

When creating a note or to-do, focus is not set correctly

Open laurent22 opened this issue 11 months ago • 1 comments

The focus should be either the note title or body, depending on the settings, but currently this is broken. It briefly focuses the title or body, and then something else steals the focus (maybe the note list?)

laurent22 avatar Mar 12 '24 16:03 laurent22

Hey @laurent22, I tested this issue, it seems to me that it only happens if we click on New Note/New Todo twice.

Screencast from 2024-03-13 11-19-20.webm

OS: Linux (Fedora)

Shivam164 avatar Mar 13 '24 05:03 Shivam164

Hey, I think the problem can be resolved by explicitly setting the focus to the text area. This is my first issue in the codebase, so can I work on this issue and try fixing it so that I get to learn about the codebase?

TheShiveshNetwork avatar Mar 14 '24 09:03 TheShiveshNetwork

In my testing, there's two different behaviors depending on the following conditions:

  1. If there is no other notes in the notebook, focus is not set at all. This is likely the environment of this issue.
  2. If there is at least one other note in the notebook, then the behavior that @Shivam164 described occurs where it only occurs when clicking on "New Note" twice

I've been looking into fixing this; I'm guessing there is actually a missing function or the code to focus on the textbox of the note is out of order since the app doesn't seem to be even trying to focus on the created note given the focus event listener in the devtools doesn't fire at all, but please correct me if I am wrong.

chaNcharge avatar Mar 14 '24 09:03 chaNcharge