Skip to content

Commit

Permalink
fix(text-field): Do not import constants from @material/textfield int…
Browse files Browse the repository at this point in the history
…ernals (#639)
  • Loading branch information
gugu authored and Matt Goo committed Feb 19, 2019
1 parent 63e1fce commit 3b3a0ab
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/text-field/Input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ import * as React from 'react';
import * as classnames from 'classnames';
// @ts-ignore no .d.ts file
import {MDCTextFieldFoundation} from '@material/textfield/dist/mdc.textfield';
// @ts-ignore no .d.ts file
import {VALIDATION_ATTR_WHITELIST} from '@material/textfield/constants';

export interface InputProps<T> {
className: string;
Expand Down Expand Up @@ -58,6 +56,11 @@ declare type ValidationAttrWhiteList =
declare type ValidationAttrWhiteListReact =
Exclude<ValidationAttrWhiteList, 'minlength' | 'maxlength'> | 'minLength' | 'maxLength';

const VALIDATION_ATTR_WHITELIST: ValidationAttrWhiteList[] = [
'pattern', 'min', 'max', 'required', 'step', 'minlength', 'maxlength',
];


export default class Input<T extends {}> extends React.Component<
Props<T>, InputState
> {
Expand Down

0 comments on commit 3b3a0ab

Please sign in to comment.