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

[BUG] EditTextWidget size=1 is not size=1 #6165

Closed
twMat opened this issue Nov 3, 2021 · 2 comments
Closed

[BUG] EditTextWidget size=1 is not size=1 #6165

twMat opened this issue Nov 3, 2021 · 2 comments

Comments

@twMat
Copy link
Contributor

twMat commented Nov 3, 2021

EditTextWidget doc reads:

|size |The size of the input field (in characters)|

...but in practice the width of another 4-5 characters is added. So any width less than that doesn't work, for example:

<$edit-text tag=input size=1/>

shows an input field that is at least 5 characters wide.

Any applied class also seems to be overrun by this.

The incorrect minimal width setting is a problem because it takes up too much real estate. I sometimes make "editable tables" where each cell is intended to only hold a single or very few characters but because of this issue the table becomes too wide.

@saqimtiaz
Copy link
Contributor

The size attribute of $edittext sets the size attribute of the generated input element, how that is rendered is dependent on the browser, see https://www.w3schools.com/tags/att_input_size.asp

A documentation update to clarify this further would be welcome if you feel it is needed. Controlling the width more precisely would need to be done via applying a custom class and your own CSS that sets the width, perhaps in em.

@twMat
Copy link
Contributor Author

twMat commented Nov 3, 2021

dependent on the browser

Oh, that was surprising to hear. Thanks. And, to my (second) surprise it does work with CSS... I did test it before I posted but must have done... whatever, thank you :-)

I'll edit the docs.

[closing]

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

No branches or pull requests

2 participants