Skip to content

Commit

Permalink
[fix] masked input was disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
blcham committed Nov 27, 2016
1 parent 03d3c44 commit 0bda2cf
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/components/MaskedInput.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';

import React from "react";
import ReactDOM from "react-dom";
import InputMask from "inputmask-core";
import {getSelection, setSelection} from "react/lib/ReactInputSelection";
import assign from "object-assign";
Expand Down Expand Up @@ -197,7 +198,11 @@ export default class MaskedInput extends React.Component {
var {size, placeholder, ...props} = this.props;
var patternLength = this.mask.pattern.length;
return React.createElement(Configuration.inputComponent, assign({}, props, {
ref: r => this.input = r.refs ? r.refs.input : r,
ref: (r) => {
if (r) {
this.input = r.input ? ReactDOM.findDOMNode(r.input) : r;
}
},
maxLength: patternLength,
onChange: this._onChange,
onKeyDown: this._onKeyDown,
Expand Down

0 comments on commit 0bda2cf

Please sign in to comment.