joplin icon indicating copy to clipboard operation
joplin copied to clipboard

Search field focus is steal on layout change

Open JackGruber opened this issue 2 years ago • 13 comments

The search field loses focus if a plugin or command change the editor (markdown or rich text) or the layout (splitview, preview) with toggleVisiblePanes and toggleEditors.

For the plugins, the problem has become worse since the performance optimization of Joplin, because the list is updated quickly and therefore a note is displayed more quickly, which then triggers the command. This happens all the time when you only pause for a moment when entering text in the search box.

Environment

Joplin 2.8.6 (prod, win32)

Client ID: 6c4a316296944e2eb07a539f4d50eeb1 Sync Version: 3 Profile Version: 41 Keychain Supported: Yes

Revision: 2486c78

Steps to reproduce

Manually:

  1. Set Layout to preview
  2. Start searching
  3. Use shortcut to switch the Layout Ctr+L
  4. Now the editor window has the focus

Plugin:

  1. Install Persist Editor Layout Plugin
  2. Add the tag layout:viewer for the 4. Tips note in the Welcome! (Desktop)
  3. Configure in the Persist Editor Layout Plugin settings the Default editor layout to Split View
  4. Search for tips and wait a second
  5. Search list is updated and the focus of the search field is steal through the plugin API commandos toggleVisiblePanes / toggleEditors.

Describe what you expected to happen

The focus should remain in the search field

Additional information

https://github.com/benji300/joplin-persistent-layout/issues/12 https://discourse.joplinapp.org/t/persist-editor-layout-plugin/14411/47 https://discourse.joplinapp.org/t/i-have-found-some-problems-using-joplin-search-feature/25561

Plugins that cause the problem

JackGruber avatar May 14 '22 07:05 JackGruber

Joplin 2.9.4 - there's still a bug here.

I'm still losing focus from the search box while typing a search. It seems to happen consistently when I do the reverse of the steps for reproducing above: switching from preview to editor view steals the focus from the search box.

mzguy avatar Dec 13 '22 19:12 mzguy

@JackGruber Can you confirm this is still occurring?

mzguy avatar Dec 30 '22 16:12 mzguy

No the error for stealing the focus of the search field in combination with plugins and the toggleVisiblePanes / toggleEditors command was fixed.

JackGruber avatar Dec 30 '22 17:12 JackGruber

No the error for stealing the focus of the search field in combination with plugins and the toggleVisiblePanes / toggleEditors command was fixed.

I'm on 2.9.4, and I'm still having focus stealing during search as described above.

mzguy avatar Dec 30 '22 17:12 mzguy

@laurent22 Could you reopen the Issue or should I create a new one.

It seems that the problem now occurs again when switching from viewer to editor during the search (With the persistent layout plugin) or if you scroll up and down in the note list with the arrow keys and the layout is switched through the plugin persistent layout.

This also happens when the layout is changed with Ctrl+L

I tested this with Joplin 2.9.17 and 2.10.13

JackGruber avatar Jan 04 '23 15:01 JackGruber

Is that he exact same problem with the same steps to reproduce?

laurent22 avatar Jan 04 '23 16:01 laurent22

Yes, the problem can be reproduced with the plugin and manual steps from the Issue.

JackGruber avatar Jan 06 '23 07:01 JackGruber

The error occurs again in version 2.9.12 and higher

JackGruber avatar Jan 06 '23 08:01 JackGruber

Any update on this one? I see release notes stating that search focus issues were fixed in pre-release versions over the past month, but this issue seems to still be occurring.

mzguy avatar Mar 27 '23 18:03 mzguy

Error is still there on 2.11.2

JackGruber avatar May 13 '23 15:05 JackGruber

@laurent22 @JackGruber

Is this a fix for this issue?

https://github.com/laurent22/joplin/commit/489d6778dbd3df5372d198a23af1b36416b0f5c0

Or is there something else that causes loss of focus as described here?

mzguy avatar Jun 09 '23 16:06 mzguy

The problem still exist in 2.11.9

JackGruber avatar Jun 10 '23 09:06 JackGruber

It's still there in 2.11.11.

Is this not getting fixed because of the Plugin label? It's triggered by a plugin, but the cause isn't a plugin.

mzguy avatar Jun 30 '23 22:06 mzguy

This problem still occurs, if the "outline" plugin has the "auto hide" option switched on.

corwin42 avatar Oct 30 '23 14:10 corwin42