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

Remove cols="30" rows="10" from textarea Snippet #725

Open
wesbos opened this issue Dec 15, 2023 · 5 comments
Open

Remove cols="30" rows="10" from textarea Snippet #725

wesbos opened this issue Dec 15, 2023 · 5 comments

Comments

@wesbos
Copy link

wesbos commented Dec 15, 2023

Following up on this issue from @LeaVerou #582

<textarea name="" id="" cols="30" rows="10"></textarea>

Could we talk about removing cols and rows from the textarea snippet? Or at least making it a tab highlight to easily delete?

I think very few people use cols/rows to size textareas these days, as sizing it via CSS with width, height, block/inline size, or the upcoming field-sizing attribute are all ways to control how large the text area is.

If someone does want the textarea to be sized based on font size, using with/height with ems in css is a better route

All browsers provide a reasonable default for textarea.

@LeaVerou
Copy link

+1000

And maybe after that we can remove <label for>, which I keep having to delete when the control is inside the label

@sergeche
Copy link
Member

Agree, cols and rows look obsolete these days, will remove them.

@LeaVerou I can add a special processing which will remove default for attribute in <label> if it contains input. What do you think about it?

@LeaVerou
Copy link

@LeaVerou I can add a special processing which will remove default for attribute in <label> if it contains input. What do you think about it?

That sounds way better than I hoped! Best of both worlds! (make sure to also take select and textarea into account, not just input)

@theperfectpunk
Copy link
Contributor

@sergeche raised a PR for textarea, will be raising a PR for label with input processor

@sergeche
Copy link
Member

Just published v2.4.7 which contains label preprocessor that removes for attribute if it contains <input> or <textarea> element. Removed empty id attribute from input as well

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

4 participants