diff --git a/source/dom/Control.js b/source/dom/Control.js index d9a1e3d41..1d9170f18 100644 --- a/source/dom/Control.js +++ b/source/dom/Control.js @@ -514,6 +514,24 @@ enyo.kind({ hide: function() { this.setShowing(false); }, + //* Focus on this control + focus: function() { + if (this.hasNode()) { + this.node.focus(); + } + }, + //* Blur this control + blur: function() { + if (this.hasNode()) { + this.node.blur(); + } + }, + //* Returns true if the control is focused. + hasFocus: function() { + if (this.hasNode()) { + return document.activeElement === this.node; + } + }, /** Returns an object describing the geometry of this object, like so: diff --git a/source/ui/Input.js b/source/ui/Input.js index ff2298912..253315007 100644 --- a/source/ui/Input.js +++ b/source/ui/Input.js @@ -114,24 +114,6 @@ enyo.kind({ clear: function() { this.setValue(""); }, - //* Focus on this input - focus: function() { - if (this.hasNode()) { - this.node.focus(); - } - }, - //* Blur this input - blur: function() { - if (this.hasNode()) { - this.node.blur(); - } - }, - //* Returns true if the Input is focused. - hasFocus: function() { - if (this.hasNode()) { - return document.activeElement === this.node; - } - }, // note: we disallow dragging of an input to allow text selection on all platforms dragstart: function() { return this.hasFocus();