Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Çağatay Çivici committed Jan 4, 2018
1 parent 3c91de2 commit 4983f92
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions src/components/inputtext/InputText.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ export class InputText extends Component {
static defaultProps = {
onInput: null,
onKeyPress: null,
keyFilter: null
keyfilter: null
};

static propTypes = {
onInput: PropTypes.func,
onKeyPress: PropTypes.func,
keyFilter: PropTypes.any
keyfilter: PropTypes.any
};

constructor(props) {
Expand All @@ -28,8 +28,8 @@ export class InputText extends Component {
this.props.onKeyPress(event);
}

if (this.props.keyFilter) {
KeyFilter.onKeyPress(event, this.props.keyFilter)
if (this.props.keyfilter) {
KeyFilter.onKeyPress(event, this.props.keyfilter)
}
}

Expand Down
16 changes: 8 additions & 8 deletions src/showcase/keyfilter/KeyFilterDemo.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,28 +19,28 @@ export class KeyFilterDemo extends Component {
<h3 className="first">Filtering</h3>
<div className="ui-g ui-fluid">
<div className="ui-g-12 ui-md-4">
<InputText keyFilter="int" placeholder="Integers"/>
<InputText keyfilter="int" placeholder="Integers"/>
</div>
<div className="ui-g-12 ui-md-4">
<InputText keyFilter="num" placeholder="Numbers"/>
<InputText keyfilter="num" placeholder="Numbers"/>
</div>
<div className="ui-g-12 ui-md-4">
<InputText keyFilter="money" placeholder="Money"/>
<InputText keyfilter="money" placeholder="Money"/>
</div>
<div className="ui-g-12 ui-md-4">
<InputText keyFilter="hex" placeholder="Hex"/>
<InputText keyfilter="hex" placeholder="Hex"/>
</div>
<div className="ui-g-12 ui-md-4">
<InputText keyFilter="alpha" placeholder="Alphabetic"/>
<InputText keyfilter="alpha" placeholder="Alphabetic"/>
</div>
<div className="ui-g-12 ui-md-4">
<InputText keyFilter="alphanum" placeholder="Alphanumberic"/>
<InputText keyfilter="alphanum" placeholder="Alphanumberic"/>
</div>
<div className="ui-g-12 ui-md-4">
<InputText keyFilter={/^[^#<>*!]+$/} placeholder="Block # < > * !"/>
<InputText keyfilter={/^[^#<>*!]+$/} placeholder="Block # < > * !"/>
</div>
<div className="ui-g-12 ui-md-4">
<InputText keyFilter={/[^\s]/} placeholder="Block space key"/>
<InputText keyfilter={/[^\s]/} placeholder="Block space key"/>
</div>
</div>
</div>
Expand Down

0 comments on commit 4983f92

Please sign in to comment.