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

Individual favorites are displayed more broadly than expected #8

Open
benji300 opened this issue Mar 2, 2021 · 4 comments
Open

Individual favorites are displayed more broadly than expected #8

benji300 opened this issue Mar 2, 2021 · 4 comments
Labels
bug Something isn't working

Comments

@benji300
Copy link
Owner

benji300 commented Mar 2, 2021

Regardless of the setting of the minimum and maximum favorite width options, individual favorites are displayed too wide.

From the forum post: https://discourse.joplinapp.org/t/notebook-note-to-do-tag-search-favorites-plugin/14049/48

@benji300 benji300 added the bug Something isn't working label Mar 2, 2021
@benji300
Copy link
Owner Author

benji300 commented Mar 2, 2021

Short analysis showed that it is caused by the added input fields for the favorite titles. These tags have a "size" attribute which has a default value of "20" (https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/text#size). Which should correspond approximately to a width of 100px.

@GlassGruber
Copy link

Hey @benji300
I've tried to poke the CSS and you are right the main problem is the input element.

May I ask why not replace input with a simple span element? With a very rapid test via devtools I see that tabs width extend only to cover the length of the text inside the <span>.
Full disclosure I'm not very much into electron and Joplin plugin developing, so I hope this is not a RTFM question 😝

Anyway thank you for your extension! 🎩

@benji300
Copy link
Owner Author

Hi @GlassGruber,
I've added the input to allow inline renaming of the favorites. So opening the edit dialog is no longer necessary.
And a input element was the easiest way to enable this functionality. Unfortunately I've overseen this behavior with "minimum" size/width of input elements.

Now I know there's also another way to add this functionality. It is possible to allow also editing of span elements (https://stackoverflow.com/questions/21432238/make-a-span-item-editable).
I will try this solution once I have time to fix this issue.

@GlassGruber
Copy link

Very nice! And thank you I didn't know contenteditable, you can learn something cool every day!

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

No branches or pull requests

2 participants