huntabyte / shadcn-svelte

shadcn/ui, but for Svelte. ✨
https://shadcn-svelte.com
MIT License
4.88k stars 303 forks source link

Add boolean property to textarea to turn on auto-growing #325

Closed Evertt closed 10 months ago

Evertt commented 11 months ago

Describe the feature in detail (code, mocks, or screenshots encouraged)

Well I guess we all know what I'm talking about right? Some textarea inputs on the web automatically become taller when you start to type more lines than its initial height can show. It'd be nice if the textarea in this project had an option to do something similar.

What type of pull request would this be?

Enhancement

(What's the difference between a new feature and an enhancement?)

huntabyte commented 11 months ago

I guess a new feature would be something from scratch, where as an enhancement would be improving an existing component/feature, but not 100% sure 😂

How do you think this would be implemented? I think this is a solid feature, so if you're down for implementing it I can assign the issue to you!

Evertt commented 11 months ago

You're not using storybooks right? Or am I supposed to be looking at another repo for that?

Maybe that's a stupid question. The thing is, I'm currently working on this and I'm noticing that I find it hard to make certain UX decisions. Such as:

If these components came with storybooks and I knew where to find them, then I could just give you all the variations I can think of, and then you can maybe choose which one you think makes the most sense.

edit

By the way, it's a significant amount of added code. And I don't mean to say that as "poor me", but just to say that the component started out very simple, neat and clean. And it's getting a little messier now. 😅

huntabyte commented 10 months ago

Hey @Evertt, after thinking about this, maybe it's not a great idea to add as part of the lib, just due to the (potentially) unnecessary complexity it adds for those who don't need the feature.

However, if you wanted to add an example to the docs demonstrating how to accomplish this, that would be awesome!

mattf96s commented 10 months ago

I think an autosizing text-area is going to be natively supported soon.

huntabyte commented 10 months ago

I saw this as well @mattf96s! Will be incredible!

In the meantime, I'm going to close this issue, but feel free to add an example if you wish @Evertt!