Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

fix: textarea event error #491

Merged
merged 10 commits into from
Jan 19, 2022
Merged

fix: textarea event error #491

merged 10 commits into from
Jan 19, 2022

Conversation

peoray
Copy link
Contributor

@peoray peoray commented Sep 29, 2021

Description

When using the event @change in <CTextarea v-if="isTextArea" placeholder="Insert your text" v-model="text" @change="handleText" />, it displays an error that it is not a function.

This PR fixes the error and allows the change event to be used on the CTextarea component and adds a story with the change event.

Motivation and Context

Fixes #356

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@changeset-bot
Copy link

changeset-bot bot commented Sep 29, 2021

🦋 Changeset detected

Latest commit: 3d2ab89

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@chakra-ui/vue Patch
@chakra-ui/nuxt Patch
@chakra-ui/theme-vue Patch
chakra-ui-docs Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Sep 29, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployments, click below or on the icon next to each commit.

chakra-ui-vue – ./

🔍 Inspect: https://vercel.com/chakra-ui/chakra-ui-vue/BhNu4Y6ohXd5tCWVFjLE1Q1R1cCn
✅ Preview: https://chakra-ui-vue-git-fix-textarea-event-error-chakra-ui.vercel.app

@codesandbox-ci
Copy link

codesandbox-ci bot commented Sep 29, 2021

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 3d2ab89:

Sandbox Source
Chakra UI Vue (0.X) Starter Template Configuration
chakra-ui-nuxt-demo Configuration

@codebender828 codebender828 self-requested a review October 7, 2021 15:00
@codebender828 codebender828 changed the title Fix/textarea event error fis: textarea event error Oct 7, 2021
@codebender828 codebender828 changed the title fis: textarea event error fix: textarea event error Oct 7, 2021
Comment on lines -66 to 71
emitChange(value, $e)
if (typeof emitChange === 'function') {
return emitChange(value, $e)
}
emitChange.forEach(listener => listener(value, $e))
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this change @peoray. Do you think we can add a test case for this change?

@codebender828
Copy link
Collaborator

One more thing I found missing this PR is that v-model breaks. Do you want to look into this?

See reproduction here:
https://codesandbox.io/s/chakra-ui-vue-0-x-starter-template-forked-xvm2m?file=/src/App.vue

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

Successfully merging this pull request may close these issues.

TextArea: Error when using the events @change and @input
2 participants