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

feat(useTextareaAutosize): new function #1756

Merged
merged 7 commits into from Jul 6, 2022
Merged

feat(useTextareaAutosize): new function #1756

merged 7 commits into from Jul 6, 2022

Conversation

innocenzi
Copy link
Contributor

Description

This function makes it easy to make a textarea automatically grow depending on its content. This is something not easily achievable when not knowing the underlying trick.

<script setup lang="ts">
const { textarea, input } = useTextarea()
</script>

<template>
  <textarea
    ref="textarea"
    v-model="input"
    class="resize-none"
    placeholder="What's on your mind?"
  />
</template>

What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

@antfu
Copy link
Member

antfu commented Jul 6, 2022

Could we also have a directive version of it?

@innocenzi
Copy link
Contributor Author

innocenzi commented Jul 6, 2022

Could we also have a directive version of it?

That would be nice, but I didn't manage to properly test it when I tried to make one, I have no experience with directives. I may try to PR one in the future though, if that's okay?

@antfu antfu merged commit 4c37839 into vueuse:main Jul 6, 2022
@innocenzi innocenzi deleted the feat/use-textarea-autosize branch July 6, 2022 18:50
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

Successfully merging this pull request may close these issues.

None yet

2 participants