Sitelet https://web.archive.org/web/20210427092104/https://github.com/laurent22/joplin/issues/4813
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

Converting a selection to a bulleted or numbered list results in adding an extra row to the list #4813

Open
dlampa opened this issue Apr 6, 2021 · 8 comments

Comments

@dlampa
Copy link

@dlampa dlampa commented Apr 6, 2021

Environment

Joplin version: 1.7.11
Platform: Linux
OS specifics: Ubuntu 20.04 LTS

Steps to reproduce

After selecting a block of text (see screenshot) and clicking the "Bulleted list" button in the toolbar, an additional - bullet item is added to the row immediately below the selection:

(selected 3 rows)
image

After converting to a bulleted list (selection was extended automatically by the editor):
image

Describe what you expected to happen

  • Only convert the selected rows to a bulleted list.

  • Note that the same issue occurs when converting a selection to a Numbered List.

  • Changing the font appearance (i.e. Bold/Italic) works as expected - changes are only applied to selection.

Logfile

@dlampa dlampa added the bug label Apr 6, 2021
@CalebJohn
Copy link
Collaborator

@CalebJohn CalebJohn commented Apr 7, 2021

I can't reproduce this issue. But it looks like maybe you have started your selection on the fourth line? So if you dragged up from the beginning of the fourth line, or started your cursor on the fourth line this is the expected behaviour.

@dlampa
Copy link
Author

@dlampa dlampa commented Apr 7, 2021

Thanks for responding!

I normally select a row by holding shift + down arrow from the first char in Line 1 (i.e. press down arrow 3x) . The cursor disappears and it looks like only Line 1, 2 and 3 are selected.

However, if I either:

  • use the mouse and drag from Line 1 char 1 down to end of Line 3
  • or press Shift + End in the first row, then while holding shift press arrow down key twice to select till the end of Line 3

then: there is no issue - only the first 3 lines are bulleted as expected.

@unserh
Copy link

@unserh unserh commented Apr 7, 2021

Hey, first timer here - based on what you described @dlampa could it be due to the cursor position? Using your approach, the cursor ends up on the 4th line (even though the line isn't fully highlighted) so that could be why that line ends up bulleted as well. With the other approaches, the cursor doesn't reach line 4. Not sure if that's expected behavior or not, just an observation!

@dlampa
Copy link
Author

@dlampa dlampa commented Apr 7, 2021

Thank you for taking the time to check this out @unserh - I suppose it's most likely an issue specific to my setup, since the cursor becomes invisible as soon as I make a text selection of any kind, which is probably what led to the confusion in the first place. I agree that if cursor was in Line 4 the behaviour would make complete sense.

@CalebJohn Not sure if the invisible cursor on selection is normal?

@CalebJohn
Copy link
Collaborator

@CalebJohn CalebJohn commented Apr 9, 2021

@dlampa
I just tested this out using google docs to see how it's handled elsewhere. They also have an invisible cursor (which I'm fairly certain is normal). Pressing delete also behaves as if the cursor was on the last line. But the list insertion works the way you expected it to. I think they probably check if the end of a selection is at the start of a line and ignore it when inserting list elements.

I think we should probably do the same.

@dlampa
Copy link
Author

@dlampa dlampa commented Apr 9, 2021

@CalebJohn Appreciate you taking the time to look into this further! I've also tried the same on LibreOffice Writer and Apple Pages. Unfortunately I don't have access to Word to check it's behaviour. In Writer, the cursor blinks at the beginning of the last line and behaves identically to Joplin (adding a list item includes the last line automatically - but you can see the cursor so it's expected/implied). Apple Pages behaves like GDocs - cursor disappears on selection, and the last line is ignored when inserting list items.

@lkiThakur
Copy link
Contributor

@lkiThakur lkiThakur commented Apr 9, 2021

we should probably do the same.

with such a clear guidance, I would certainly like to try solving this issue.

@lkiThakur
Copy link
Contributor

@lkiThakur lkiThakur commented Apr 12, 2021

I have added a pull request for this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants