add blurableinput to step tiles

pull/351/head
MrChristofferson 2017-07-24 13:10:45 -05:00
parent ebb9efce23
commit 519fd62598
2 changed files with 9 additions and 4 deletions

View File

@ -2,6 +2,7 @@ import * as React from "react";
import { updateStep } from "../step_tiles/index";
import { isString, isNumber } from "lodash";
import { StepInputProps } from "../interfaces";
import { BlurableInput } from "../../ui";
export function InputDefault({
step,
@ -15,7 +16,11 @@ export function InputDefault({
let notUndefied = (isString(raw) || isNumber(raw));
let val = notUndefied ? raw : "";
return <input type={type_ || "text"}
value={val}
onChange={updateStep({ dispatch, step, field, index, sequence })} />;
return (
<BlurableInput
type={type_ || "text"}
value={val}
onCommit={updateStep({ dispatch, step, field, index, sequence })}
/>
);
}

View File

@ -5,7 +5,7 @@ interface BIProps {
onCommit(e: React.SyntheticEvent<HTMLInputElement>): void;
min?: number;
max?: number;
type?: "text" | "number" | "email" | "password" | "time" | "date";
type?: "text" | "number" | "email" | "password" | "time" | "date" | "hidden";
name?: string;
id?: string;
/** Allow the user to empty out the form control. If unset, form control