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

Input does not honor type attribute #101

Closed
mikeyGlitz opened this issue Apr 24, 2022 · 1 comment
Closed

Input does not honor type attribute #101

mikeyGlitz opened this issue Apr 24, 2022 · 1 comment

Comments

@mikeyGlitz
Copy link
Contributor

mikeyGlitz commented Apr 24, 2022

I've tried to create an Input with the following code:

              <Input
                type="date"
                {...register('expirationDate', { required: true })}
              />

What I get when the DOM renders is:

<input type="text" name="expirationDate" class="input focus:outline-offset-0 input-bordered" value="">

What I expected was:

<input type="date" name="expirationDate" class="input focus:outline-offset-0 input-bordered" value="">

I believe this line needs to be changed:
https://github.com/daisyui/react-daisyui/blob/main/src/Input/Input.tsx#L48

type={props.text}

Also, text shows up in the IDE auto-complete:
image

@benjitrosch
Copy link
Collaborator

Fixed with #102 . Thanks @mikeyGlitz!

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