Skip to content

Commit

Permalink
Merge branch 'develop' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
jigsawye committed Dec 17, 2020
2 parents 8f72436 + e60a377 commit ffee24f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/TextField/TextField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export type TextareaTextFieldProps = TextFieldSharedProps &
({ textarea: true } & TextareaProps);

export type InputTextFieldProps = TextFieldSharedProps &
({ textarea: false } & InputProps);
({ textarea?: false } & InputProps);

export type TextFieldOverload = {
(props: TextareaTextFieldProps): JSX.Element;
Expand All @@ -25,7 +25,8 @@ export type TextFieldOverload = {

const isTextarea = (
props: InputTextFieldProps | TextareaTextFieldProps
): props is TextareaTextFieldProps => 'textarea' in props && props.textarea;
): props is TextareaTextFieldProps =>
'textarea' in props && typeof props.textarea === 'boolean' && props.textarea;

const TextField: TextFieldOverload = (
props: TextareaTextFieldProps | InputTextFieldProps
Expand Down

0 comments on commit ffee24f

Please sign in to comment.