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

Label edit sometimes adds unremovable newline to label #1164

Closed
mutatrum opened this issue May 16, 2021 · 3 comments · Fixed by #1171
Closed

Label edit sometimes adds unremovable newline to label #1164

mutatrum opened this issue May 16, 2021 · 3 comments · Fixed by #1171
Labels
bug Something isn't working

Comments

@mutatrum
Copy link
Contributor

mutatrum commented May 16, 2021

Some labels have an added newline character at the end, which cannot be removed by editing the label again.

Unclear on how this happened, but specter-desktop is the only tool I use for labelling.

image
image

@ben-kaufman
Copy link
Contributor

Hi, is it possible the screen you have is just relatively small and it line breaks because there is no space?

@mutatrum
Copy link
Contributor Author

mutatrum commented May 17, 2021

No, it's a 4K screen. In the inspector, you can see the line break in the data-label field at line 3, which is translated into a <br> in the span class=label further down.

image

Also, if I query the wallet through bitcoin-cli listunspent, I see the linebreak in the output:

image

To be clear, in the case of "Label\n", I can edit the Label part, but are unable to delete the linebreak. And, as specter is the only editor of labels, it somehow appended the linebreak.

To reproduce, you can add an enter in the label field. If that's the last character, that line break is unremovable afterwards.

And finally, a strange side-effect: if there is such a linebreak character in the label and while editing the label, pressing the down key loses focus and you can't get back into the edit field without clicking on it. Normal behaviour would send the cursor to the end of the label.

@ben-kaufman
Copy link
Contributor

Thanks, can confirm the issue, I'll work on fixing it.

@ben-kaufman ben-kaufman added the bug Something isn't working label May 19, 2021
ben-kaufman added a commit to ben-kaufman/specter-desktop that referenced this issue May 19, 2021
@ben-kaufman ben-kaufman mentioned this issue May 19, 2021
stepansnigirev added a commit that referenced this issue May 21, 2021
* Fix #1164

* use rstrip

Co-authored-by: Stepan Snigirev <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants