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

[Feature]: Add event binding on the Input component #939

Open
2 tasks
olivierbourdeau opened this issue Dec 4, 2024 · 1 comment
Open
2 tasks

[Feature]: Add event binding on the Input component #939

olivierbourdeau opened this issue Dec 4, 2024 · 1 comment

Comments

@olivierbourdeau
Copy link

olivierbourdeau commented Dec 4, 2024

Describe the feature

It would be great if we could use the listener like @blur, @focus, @input, etc. on the Input component.

Additional information

  • I intend to submit a PR for this feature.
  • I have already implemented and/or tested this feature.
@Saeid-Za
Copy link
Contributor

Hello There !
Since the shad-vue Input component is itself a single html input, any event handlers would be attached directly on it via Fallthrough Attributes.

For example, this following code already works.

<script setup lang="ts">
import { Input } from '@/components/ui/input'

function onBlur(){
}

function onFocus(){
}

function onPaste(){
}
</script>

<template>
  <Input type="email" placeholder="Email"  @blur="onBlur" @focus="onFocus" @paste="onPaste"/>
</template>

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