Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command palette: Focus Issues #4759

Closed
loozai opened this issue Mar 29, 2021 · 7 comments · Fixed by #4812
Closed

Command palette: Focus Issues #4759

loozai opened this issue Mar 29, 2021 · 7 comments · Fixed by #4812
Labels
bug It's a bug desktop All desktop platforms editor medium Medium priority issues

Comments

@loozai
Copy link

loozai commented Mar 29, 2021

The note looses focus after inserting a checkbox/listbox/codeblock etc. using the command palette (ctrl-shift-p)

Environment

Joplin version: 1.7.11
Platform: Windows
OS specifics: Windows 10

Steps to reproduce

  1. create a new note and enter some freetext
  2. press ctrl-shift-p to activate the command palette
  3. start typing "check" and then press enter
  4. this creates a checkbox with highlighted text "List Item"
  5. the note looses focus so that I can't immediately continue writing without clicking into the note to regain focus.

Affected items (as far as my short tests went):
Horizontal rule, Checkbox, Bullet List, Numbered List, Heading

This happens in the marktown editor in both views (ctrl-L)
In the WYSIWIG Editor, the checkbox isn't even created.

What I expect:

press ctrl-shift-p and insert a hyperlink -> here, the cursor is placed between the square brackets and you can immediately continue typing.

@loozai loozai added the bug It's a bug label Mar 29, 2021
@laurent22 laurent22 added desktop All desktop platforms editor medium Medium priority issues labels Mar 29, 2021
@coderrsid
Copy link
Contributor

I can reproduce this problem. But i guess there are more underlying problems too. Some of which i noticed.

  1. After adding checkbox, it doesn't gives a new line space, instead adds checkbox before the current text/element in current line.
  2. Checkbox, Horizontal rule, Checkbox, Bullet List, Numbered List, Heading cannot be added WYSIWIG editor by Cmd+Shift+P, weird and even if we add in markdown editor, the current behaviour does not match expected one.

@aksh-konda
Copy link
Contributor

Hi @coderrsid,
I tried reproducing your mentioned problems and it is working as expected for me.

  1. After adding a checkbox, the new line is added if there is text before the cursor in the current line i.e if the cursor is in between the text or at the end of the text it is adding a new line, checkbox, and text after the cursor (if there is any). which is what I think is the desired action.

can you please try pulling the latest code from the Joplin repo and executing it?

@loozai
Copy link
Author

loozai commented Mar 31, 2021

Hi @aksh-konda
You describe exactly the behaviour when the checkbox is added by pressing the checkbox button on the toolbar.
Can you also reproduce this behaviour by adding a checkbox via command palette (ctrl-shift-p)?

@aksh-konda
Copy link
Contributor

Hi @loozai ,
Yes. Actually I was specifically talking about the checkbox inserted through command palette.

The focus issue is definitely there and I fixed it. Waiting for @coderrsid to reply. So that I can make a PR if there are no other issues.

@coderrsid
Copy link
Contributor

1. After adding a checkbox, the new line is added if there is text before the cursor in the current line i.e if the cursor is in between the text or at the end of the text it is adding a new line, checkbox, and text after the cursor (if there is any). which is what I think is the desired action. Can you please try pulling the latest code from the Joplin repo and executing it?

So @aksh-konda, the latest dev code responds this way..
Screen-Recording-2021-03-31-at-1

So as you can see in TinyMCE, the checkbox is not even added and in MD editor, the checkbox is added where the cursor position was last set in TinyMCE without a new line space after it.
Can you please share if any other behavior is shown in your build?

@aksh-konda
Copy link
Contributor

aksh-konda commented Mar 31, 2021

@coderrsid, I'm sorry I didn't check it in TinyMCE.

  1. After adding a checkbox, the new line is added if there is text before the cursor in the current line i.e if the cursor is in between the text or at the end of the text it is adding a new line, checkbox, and text after the cursor (if there is any). which is what I think is the desired action.

But, what I said above is definitely applicable for the MD editor.

So as you can see in TinyMCE, the checkbox is not even added and in MD editor, the checkbox is added where the cursor position was last set in TinyMCE without a new line space after it.

Yeah. Because there is no text before the position of the cursor and so the checkbox need not be on a new line.

@coderrsid
Copy link
Contributor

Yeah so that's why description said in TinyMCE it doesn't even work.
In MD, the expected behaviour should be to add checkbox with List Item to be editable and should bring the text after in the new line. Senior developers can confirm it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug It's a bug desktop All desktop platforms editor medium Medium priority issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants