benji300 / joplin-persistent-layout

Save editor layout (editor/split view/viewer/rich text) for each note separately.
MIT License
17 stars 3 forks source link

Global search loses focus on layout switch during typing #12

Closed benji300 closed 2 years ago

benji300 commented 3 years ago

I found a bug being caused by the plugin. It's very annoying, and can also result in unintentional changes to notes. To replicate:

Open Joplin and set up the plugin to default to Split View. Add a tag (let's call it "Rendered" here) for rendered markdown editor view. Navigate to a note that is set to go to default view. Go to the search box, and start typing text that will cause the search results list to bring a note with the Rendered tag to the top of the search results list. Watch the note switch to the rendered view as it should. The search box loses focus and the note gains focus! This shouldn't happen. The loss of focus in the search box is a significant issue. There are two big problems with this:

When typing in the search box, partial results display as one types. For example, if I am searching for "schoolbus", "school" might cause the results list to update and the search box to lose focus, making it impossible to type "schoolbus" without clicking back into the search box. This sort of thing happens all the time, since a few characters in the search box very often brings up results that cause a change in the viewer layout. If the search results in a note switching from rendered view to split view or markdown view, the note body gains focus. Characters being typed into the search box now begin appearing in the note body, causing unintended changes to the note. Disabling the plugin makes the above issue go away.

Copied from forum: https://discourse.joplinapp.org/t/persist-editor-layout-plugin/14411/45

mzguy commented 2 years ago

This bug allows unintended changes to notes (data loss). Is it being addressed?

benji300 commented 2 years ago

Fixed in latest App pre-release version v2.9.1.

mzguy commented 1 year ago

I'm on v2.9.4 and I'm still losing focus during search. Can someone else test please?