Skip to content

Commit

Permalink
Corrects issue editable textboxes in Caret Browsing in IE
Browse files Browse the repository at this point in the history
  • Loading branch information
schallm authored and dylans committed Feb 17, 2018
1 parent 0e35b94 commit b1d6996
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
11 changes: 9 additions & 2 deletions form/_FormValueMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ define([
"dojo/keys", // keys.ESCAPE
"dojo/_base/lang",
"dojo/on",
"dojo/sniff", // has("webkit")
"./_FormWidgetMixin"
], function(declare, domAttr, keys, lang, on, _FormWidgetMixin){
], function(declare, domAttr, keys, lang, on, has, _FormWidgetMixin){

// module:
// dijit/form/_FormValueMixin
Expand All @@ -26,7 +27,13 @@ define([
readOnly: false,

_setReadOnlyAttr: function(/*Boolean*/ value){
domAttr.set(this.focusNode, 'readOnly', value);
// IE has a Caret Browsing mode (hit F7 to activate) where disabled textboxes can be modified
// focusNode enforced readonly if currently disabled to avoid this issue.
if (has('trident') && 'disabled' in this) {
domAttr.set(this.focusNode, 'readOnly', value || this.disabled);
} else {
domAttr.set(this.focusNode, 'readOnly', value);
}
this._set("readOnly", value);
},

Expand Down
5 changes: 5 additions & 0 deletions form/_FormWidgetMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ define([
// Can't use "disabled" in this.focusNode as a test because on IE, that's true for all nodes.
if(/^(button|input|select|textarea|optgroup|option|fieldset)$/i.test(this.focusNode.tagName)){
domAttr.set(this.focusNode, 'disabled', value);
// IE has a Caret Browsing mode (hit F7 to activate) where disabled textboxes can be modified
// textboxes marked readonly if disabled to avoid this issue.
if (has('trident') && 'readOnly' in this) {
domAttr.set(this.focusNode, 'readonly', value || this.readOnly);
}
}else{
this.focusNode.setAttribute("aria-disabled", value ? "true" : "false");
}
Expand Down

0 comments on commit b1d6996

Please sign in to comment.