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

fix: input type not being passed to input #23

Merged
merged 2 commits into from
Sep 10, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/components/Input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
InputGroupText,
Label,
} from 'reactstrap';
import {InputType} from 'reactstrap/lib/Input';

import {DefaultInputProps, FormConfig} from '../interfaces/FormConfig';

Expand All @@ -18,7 +19,7 @@ export default ({elementConfig, formHooks, valid}: DefaultInputProps) => {
const {errors, formState, getValues, register, triggerValidation} = formHooks;
const values = getValues();

const {addon, className, name, placeholder} = elementConfig;
const {addon, className, inputType, name, placeholder} = elementConfig;

const getInputRegisters = (
elementConfig: FormConfig,
Expand Down Expand Up @@ -56,6 +57,7 @@ export default ({elementConfig, formHooks, valid}: DefaultInputProps) => {
</InputGroupAddon>
)}
<Input
type={inputType as InputType}
name={name}
innerRef={register({...getInputRegisters(elementConfig)})}
valid={
Expand Down