Skip to content

Commit fa071fa

Browse files
committed
Fixed readOnly event handling bug
1 parent 0a520ec commit fa071fa

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

src/Control.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,11 @@ define(
384384
this.states[state] = 1;
385385
helper.addStateClasses(this, state);
386386
var properties = {};
387-
properties[state] = true;
387+
var statePropertyName = state.replace(
388+
/-(\w)/,
389+
function (m, c) { return c.toUpperCase(); }
390+
);
391+
properties[statePropertyName] = true;
388392
this.setProperties(properties);
389393
}
390394
},
@@ -399,7 +403,11 @@ define(
399403
delete this.states[state];
400404
helper.removeStateClasses(this, state);
401405
var properties = {};
402-
properties[state] = false;
406+
var statePropertyName = state.replace(
407+
/-(\w)/,
408+
function (m, c) { return c.toUpperCase(); }
409+
);
410+
properties[statePropertyName] = false;
403411
this.setProperties(properties);
404412
}
405413
},

src/InputControl.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ define(
7373
* @type {Array.<string>}
7474
* @protected
7575
*/
76-
ignoreStates: Control.prototype.ignoreStates.concat('readOnly'),
76+
ignoreStates: Control.prototype.ignoreStates.concat('read-only'),
7777

7878
/**
7979
* 获得应当获取焦点的元素

0 commit comments

Comments
 (0)